From ce93a0309823642532068489dd603dea1d747e91 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 9 Nov 2019 12:16:25 +0100 Subject: [PATCH] Fix tests on Windows Python 3.8 --- unit_test/environment_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unit_test/environment_test.py b/unit_test/environment_test.py index 0f0f385e..1bc95374 100644 --- a/unit_test/environment_test.py +++ b/unit_test/environment_test.py @@ -1,3 +1,4 @@ +import os from cibuildwheel.environment import parse_environment @@ -37,12 +38,15 @@ def test_inheritance(): def test_shell_eval(): environment_recipe = parse_environment('VAR="$(echo "a test" string)"') + env_copy = os.environ.copy() + env_copy.pop('VAR', None) + environment_dict = environment_recipe.as_dictionary( - prev_environment={} + prev_environment=env_copy ) environment_cmds = environment_recipe.as_shell_commands() - assert environment_dict == {'VAR': 'a test string'} + assert environment_dict['VAR'] == 'a test string' assert environment_cmds == ['export VAR="$(echo "a test" string)"'] def test_shell_eval_and_env():