summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-03 03:10:21 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-03 03:10:21 -0500
commitf3875aa79c616d605b86a7c60c35c627401a4953 (patch)
treec5e917516799d476f3f338926b8e9544a7811af9 /setuptools/tests/test_easy_install.py
parent1434374b64408c1a21ce75de662ca2a65e72ab1c (diff)
downloadpython-setuptools-git-f3875aa79c616d605b86a7c60c35c627401a4953.tar.gz
Use mock to patch sys.platform
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index a27fef13..cd023480 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -449,9 +449,8 @@ class TestScriptHeader:
)
@mock.patch.dict(sys.modules, java=mock.Mock(lang=mock.Mock(System=
mock.Mock(getProperty=mock.Mock(return_value="")))))
+ @mock.patch('sys.platform', 'java1.5.0_13')
def test_get_script_header_jython_workaround(self):
- platform = sys.platform
- sys.platform = 'java1.5.0_13'
stdout, stderr = sys.stdout, sys.stderr
try:
# A mock sys.executable that uses a shebang line (this file)
@@ -475,5 +474,4 @@ class TestScriptHeader:
assert candidate == '#!%s -x\n' % self.non_ascii_exe
assert 'Unable to adapt shebang line' in sys.stdout.getvalue()
finally:
- sys.platform = platform
sys.stdout, sys.stderr = stdout, stderr