Skip to content

Commit

Permalink
tests: fix failing env var unset test
Browse files Browse the repository at this point in the history
  • Loading branch information
ejseqera committed Nov 1, 2023
1 parent bb2c491 commit c190d92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/test_seqeraplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,17 @@ def test_without_env_vars(self):

def test_error_raised_for_unset_env_vars(self):
# Unset environment variables for this test
unset_var = "{UNSET_VAR}"
if "UNSET_VAR" in os.environ:
del os.environ["UNSET_VAR"]

command = ["tw", "pipelines", "list", "-w", "$UNSET_VAR"]
command = ["tw", "pipelines", "list", "-w", "${UNSET_VAR}"]

# Assert that EnvironmentError is raised
with self.assertRaises(EnvironmentError) as context:
self.sp._check_env_vars(command)
self.assertIn(
" Environment variable '$UNSET_VAR' not found!", str(context.exception)
self.assertEqual(
str(context.exception), f" Environment variable ${unset_var} not found!"
)


Expand Down

0 comments on commit c190d92

Please sign in to comment.