Skip to content

Commit b8f31ac

Browse files
committed
test uninstall after both install and -e
this used to fail with SETUPTOOLS_SYS_PATH_TECHNIQUE=raw
1 parent 3577f80 commit b8f31ac

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/functional/test_uninstall.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,3 +428,30 @@ def test_uninstall_setuptools_develop_install(script, data):
428428
) in uninstall2.files_deleted, list(uninstall2.files_deleted.keys())
429429
list_result2 = script.pip('list', '--format=legacy')
430430
assert "FSPkg" not in list_result2.stdout
431+
432+
433+
def test_uninstall_editable_and_pip_install(script, data):
434+
"""Try uninstall after pip install -e after pip install"""
435+
# SETUPTOOLS_SYS_PATH_TECHNIQUE=raw removes the assumption that `-e`
436+
# installs are always higher priority than regular installs.
437+
# This becomes the default behavior in setuptools 25.
438+
script.environ['SETUPTOOLS_SYS_PATH_TECHNIQUE'] = 'raw'
439+
440+
pkg_path = data.packages.join("FSPkg")
441+
script.pip('install', '-e', '.',
442+
expect_stderr=True, cwd=pkg_path)
443+
# ensure both are installed with --ignore-installed:
444+
script.pip('install', '--ignore-installed', '.',
445+
expect_stderr=True, cwd=pkg_path)
446+
list_result = script.pip('list', '--format=legacy')
447+
assert "FSPkg (0.1.dev0, " in list_result.stdout
448+
# Uninstall both develop and install
449+
uninstall = script.pip('uninstall', 'FSPkg', '-y')
450+
assert not any(filename.endswith('.egg-link')
451+
for filename in uninstall.files_deleted.keys())
452+
uninstall2 = script.pip('uninstall', 'FSPkg', '-y')
453+
assert join(
454+
script.site_packages, 'FSPkg.egg-link'
455+
) in uninstall2.files_deleted, list(uninstall2.files_deleted.keys())
456+
list_result2 = script.pip('list', '--format=legacy')
457+
assert "FSPkg" not in list_result2.stdout

0 commit comments

Comments
 (0)