Skip to content

Commit

Permalink
Set env var using monkeypatch (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
hosekadam authored Dec 8, 2023
1 parent 8d6376f commit 7c51cf6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions convert2rhel/unit_tests/toolopts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,7 @@ def test_should_subscribe(username, password, organization, activation_key, no_r
def test_setting_no_rpm_va(argv, env_var, expected, message, monkeypatch, global_tool_opts, caplog):
monkeypatch.setattr(sys, "argv", mock_cli_arguments(argv))
if env_var:
os.environ["CONVERT2RHEL_UNSUPPORTED_INCOMPLETE_ROLLBACK"] = "1"
else:
# Unset the variable
try:
os.environ.pop("CONVERT2RHEL_UNSUPPORTED_INCOMPLETE_ROLLBACK")
except KeyError:
pass
monkeypatch.setenv("CONVERT2RHEL_UNSUPPORTED_INCOMPLETE_ROLLBACK", 1)

try:
convert2rhel.toolopts.CLI()
Expand Down

0 comments on commit 7c51cf6

Please sign in to comment.