Skip to content

Commit

Permalink
- Test hardening for CI run.
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpojer committed Nov 8, 2024
1 parent 0d7d513 commit 9da1f58
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_version_tag_check_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def test_run_successful(mocker, tmp_path):
}
# Update os.environ with the test environment variables
os.environ.update(env_vars)
os.remove("output.txt")
if os.path.exists("output.txt"):
os.remove("output.txt")

# Mock sys.exit to prevent the test from exiting
mock_exit = mocker.patch("sys.exit")
Expand Down Expand Up @@ -115,7 +116,8 @@ def test_run_invalid_version_format(mocker, tmp_path, caplog):
"INPUT_GITHUB_REPOSITORY": "owner/repo",
}
os.environ.update(env_vars)
os.remove("output.txt")
if os.path.exists("output.txt"):
os.remove("output.txt")

# Mock sys.exit
def mock_exit(code):
Expand Down Expand Up @@ -154,7 +156,8 @@ def test_run_invalid_version_increment(mocker, tmp_path):
"INPUT_GITHUB_REPOSITORY": "owner/repo",
}
os.environ.update(env_vars)
os.remove("output.txt")
if os.path.exists("output.txt"):
os.remove("output.txt")

# Mock sys.exit
mock_exit = mocker.patch("sys.exit")
Expand Down

0 comments on commit 9da1f58

Please sign in to comment.