From c190d925ad42c5e3fb3fe850edd6b4c36870ed24 Mon Sep 17 00:00:00 2001 From: ejseqera Date: Wed, 1 Nov 2023 11:50:45 -0400 Subject: [PATCH] tests: fix failing env var unset test --- tests/unit/test_seqeraplatform.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_seqeraplatform.py b/tests/unit/test_seqeraplatform.py index d034f45..10239f0 100644 --- a/tests/unit/test_seqeraplatform.py +++ b/tests/unit/test_seqeraplatform.py @@ -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!" )