Commit 79e447fc authored by Jason R. Coombs's avatar Jason R. Coombs

Fix test failure when __PYVENV_LAUNCHER__ is set. Fixes #396.

parent bcd3e005
......@@ -488,9 +488,11 @@ class TestCommandSpec:
cmd_new = ei.CommandSpec.from_param(cmd)
assert cmd is cmd_new
@mock.patch('sys.executable', TestScriptHeader.exe_with_spaces)
@mock.patch.dict(os.environ)
def test_from_environment_with_spaces_in_executable(self):
with mock.patch('sys.executable', TestScriptHeader.exe_with_spaces):
cmd = ei.CommandSpec.from_environment()
del os.environ['__PYVENV_LAUNCHER__']
cmd = ei.CommandSpec.from_environment()
assert len(cmd) == 1
assert cmd.as_header().startswith('#!"')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment