summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-06-13 11:05:37 -0400
committerJason R. Coombs <jaraco@jaraco.com>2015-06-13 11:05:37 -0400
commiteafd254a13d1c09303102450961e313ec5317c95 (patch)
tree10c06347d0d9f3447f059fe0d46b422f4824008a
parent27033b940bf20de85d11c23172ab5ae10508c5e0 (diff)
downloadpython-setuptools-bitbucket-eafd254a13d1c09303102450961e313ec5317c95.tar.gz
Fix test failure when __PYVENV_LAUNCHER__ is set. Fixes #396.
-rw-r--r--setuptools/tests/test_easy_install.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index e71bbfc9..a690315d 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -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('#!"')