diff options
-rwxr-xr-x | setuptools/command/easy_install.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_easy_install.py | 45 |
2 files changed, 46 insertions, 1 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b7396b85..a6f61436 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -828,7 +828,7 @@ class easy_install(Command): target = os.path.join(self.script_dir, script_name) self.add_output(target) - if not self.dry_run: + if self.dry_run: return mask = current_umask() diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 834710ef..57339c8a 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -183,6 +183,51 @@ class TestEasyInstallTest: cmd.ensure_finalized() cmd.easy_install(sdist_unicode) + @pytest.fixture + def sdist_script(self, tmpdir): + files = [ + ( + 'setup.py', + DALS(""" + import setuptools + setuptools.setup( + name="setuptools-test-script", + version="1.0", + scripts=["mypkg_script"], + ) + """), + ), + ( + u'mypkg_script', + DALS(""" + #/usr/bin/python + print('mypkg_script') + """), + ), + ] + sdist_name = 'setuptools-test-script-1.0.zip' + sdist = str(tmpdir / sdist_name) + make_sdist(sdist, files) + return sdist + + @pytest.mark.skipif(not sys.platform.startswith('linux'), + reason="Test can only be run on Linux") + def test_script_install(self, sdist_script, tmpdir, monkeypatch): + """ + Check scripts are installed. + """ + dist = Distribution({'script_args': ['easy_install']}) + target = (tmpdir / 'target').ensure_dir() + cmd = ei.easy_install( + dist, + install_dir=str(target), + args=['x'], + ) + monkeypatch.setitem(os.environ, 'PYTHONPATH', str(target)) + cmd.ensure_finalized() + cmd.easy_install(sdist_script) + assert (target / 'mypkg_script').exists() + class TestPTHFileWriter: def test_add_from_cwd_site_sets_dirty(self): |