diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-03 03:39:21 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-03 03:39:21 -0500 |
commit | a849ee957f3ba12945278f88e473eb3612faf4b9 (patch) | |
tree | 2fcbdd06907ed6be79d9843300a5d51c88d76496 /setuptools/tests/test_easy_install.py | |
parent | 29f9540d973d5e2f5dbc5dd631287b6f059c8630 (diff) | |
download | external_python_setuptools-a849ee957f3ba12945278f88e473eb3612faf4b9.tar.gz external_python_setuptools-a849ee957f3ba12945278f88e473eb3612faf4b9.tar.bz2 external_python_setuptools-a849ee957f3ba12945278f88e473eb3612faf4b9.zip |
It appears as if Python 2.6 gets its warnings on a different pipe.
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r-- | setuptools/tests/test_easy_install.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index cfc4d6bf..04271178 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -462,16 +462,20 @@ class TestScriptHeader: header = get_script_header('#!/usr/local/bin/python', executable=exe) assert header == '#!/usr/bin/env %s\n' % exe + expect_out = 'stdout' if sys.version_info < (2,7) else 'stderr' + with contexts.quiet() as (stdout, stderr): # When options are included, generate a broken shebang line # with a warning emitted candidate = get_script_header('#!/usr/bin/python -x', executable=exe) assert candidate == '#!%s -x\n' % exe - assert 'Unable to adapt shebang line' in stderr.getvalue() + output = locals()[expect_out] + assert 'Unable to adapt shebang line' in output.getvalue() with contexts.quiet() as (stdout, stderr): candidate = get_script_header('#!/usr/bin/python', executable=self.non_ascii_exe) assert candidate == '#!%s -x\n' % self.non_ascii_exe - assert 'Unable to adapt shebang line' in stderr.getvalue() + output = locals()[expect_out] + assert 'Unable to adapt shebang line' in output.getvalue() |