Commit 69c9a3aa authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #1262 from benoit-pierre/fix_1261

Fix dry-run handling
parents 618312be 4d38fb98
......@@ -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()
......
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment