diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-03 02:48:22 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-03 02:48:22 -0500 |
| commit | 4af0a332c3d292932998f2ae550abc7af95f1ede (patch) | |
| tree | 7ed0d9d92000fc091ae74b653ffe2fc1a7c41674 /setuptools/tests/test_easy_install.py | |
| parent | 8c34127f5050967ef4da9be21d7bc717a3d5cdd3 (diff) | |
| download | python-setuptools-git-4af0a332c3d292932998f2ae550abc7af95f1ede.tar.gz | |
Rewrite skip/xfail
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index fc1a26d0..b364eca2 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -427,25 +427,27 @@ class TestScriptHeader: non_ascii_exe = '/Users/José/bin/python' exe_with_spaces = r'C:\Program Files\Python33\python.exe' + @pytest.mark.skipif( + sys.platform.startswith('java') and is_sh(sys.executable), + reason="Test cannot run under java when executable is sh" + ) def test_get_script_header(self): - if not sys.platform.startswith('java') or not is_sh(sys.executable): - # This test is for non-Jython platforms - expected = '#!%s\n' % nt_quote_arg(os.path.normpath(sys.executable)) - assert get_script_header('#!/usr/local/bin/python') == expected - expected = '#!%s -x\n' % nt_quote_arg(os.path.normpath(sys.executable)) - assert get_script_header('#!/usr/bin/python -x') == expected - candidate = get_script_header('#!/usr/bin/python', - executable=self.non_ascii_exe) - assert candidate == '#!%s -x\n' % self.non_ascii_exe - candidate = get_script_header('#!/usr/bin/python', - executable=self.exe_with_spaces) - assert candidate == '#!"%s"\n' % self.exe_with_spaces - + expected = '#!%s\n' % nt_quote_arg(os.path.normpath(sys.executable)) + assert get_script_header('#!/usr/local/bin/python') == expected + expected = '#!%s -x\n' % nt_quote_arg(os.path.normpath(sys.executable)) + assert get_script_header('#!/usr/bin/python -x') == expected + candidate = get_script_header('#!/usr/bin/python', + executable=self.non_ascii_exe) + assert candidate == '#!%s -x\n' % self.non_ascii_exe + candidate = get_script_header('#!/usr/bin/python', + executable=self.exe_with_spaces) + assert candidate == '#!"%s"\n' % self.exe_with_spaces + + @pytest.mark.xfail( + compat.PY3 and os.environ.get("LC_CTYPE") in (None, "C", "POSIX"), + reason="Test fails in this locale on Python 3" + ) def test_get_script_header_jython_workaround(self): - # This test doesn't work with Python 3 in some locales - if compat.PY3 and os.environ.get("LC_CTYPE") in (None, "C", "POSIX"): - return - class java: class lang: class System: |
