aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Krull <f_krull@gmx.de>2016-06-26 00:53:14 +0200
committerFelix Krull <f_krull@gmx.de>2016-06-26 01:25:53 +0200
commit9c3cdde0ddbae5684bfec874e6d8ca239ffb6379 (patch)
tree7608df0d96b4d0c6211e4d9728532f61f92e9299
parent6baa4a140f77d17e131febb3d76d0dae3ca4dfc9 (diff)
downloadexternal_python_setuptools-9c3cdde0ddbae5684bfec874e6d8ca239ffb6379.tar.gz
external_python_setuptools-9c3cdde0ddbae5684bfec874e6d8ca239ffb6379.tar.bz2
external_python_setuptools-9c3cdde0ddbae5684bfec874e6d8ca239ffb6379.zip
Split up single TestScriptHeader test into multiple tests.
-rw-r--r--setuptools/tests/test_easy_install.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 7e77e819..02f27059 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -528,29 +528,32 @@ def make_trivial_sdist(dist_path, setup_py):
dist.addfile(setup_py_file, fileobj=setup_py_bytes)
+@pytest.mark.skipif(
+ sys.platform.startswith('java') and ei.is_sh(sys.executable),
+ reason="Test cannot run under java when executable is sh"
+)
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 ei.is_sh(sys.executable),
- reason="Test cannot run under java when executable is sh"
- )
def test_get_script_header(self):
expected = '#!%s\n' % ei.nt_quote_arg(os.path.normpath(sys.executable))
actual = ei.ScriptWriter.get_script_header('#!/usr/local/bin/python')
assert actual == expected
+ def test_get_script_header_args(self):
expected = '#!%s -x\n' % ei.nt_quote_arg(os.path.normpath
(sys.executable))
actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python -x')
assert actual == expected
+ def test_get_script_header_non_ascii_exe(self):
actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python',
executable=self.non_ascii_exe)
expected = '#!%s -x\n' % self.non_ascii_exe
assert actual == expected
+ def test_get_script_header_exe_with_spaces(self):
actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python',
executable='"'+self.exe_with_spaces+'"')
expected = '#!"%s"\n' % self.exe_with_spaces