diff options
author | Stéphane Bidoul <stephane.bidoul@gmail.com> | 2023-03-18 16:03:13 +0100 |
---|---|---|
committer | Pradyun Gedam <pradyunsg@gmail.com> | 2023-03-27 11:55:20 +0100 |
commit | b31a308b08f8d0c810cbe3f9b472d2d4436503a3 (patch) | |
tree | 28edea431389626001c68ffd1056de951b9a5508 /tests | |
parent | 053b890e84b2dbdd72f520a7926532e8a5569856 (diff) | |
download | pip-b31a308b08f8d0c810cbe3f9b472d2d4436503a3.tar.gz |
Fix test_debian_egg_name_workaround
Run setup.py install manually since pip does not do it anymore.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/test_install_compat.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/functional/test_install_compat.py b/tests/functional/test_install_compat.py index 4b6b46b02..ae27ebd53 100644 --- a/tests/functional/test_install_compat.py +++ b/tests/functional/test_install_compat.py @@ -3,6 +3,7 @@ Tests for compatibility workarounds. """ import os +from pathlib import Path import pytest @@ -11,7 +12,11 @@ from tests.lib import PipTestEnvironment, TestData, assert_all_changes @pytest.mark.network -def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None: +def test_debian_egg_name_workaround( + script: PipTestEnvironment, + shared_data: TestData, + tmp_path: Path, +) -> None: """ We can uninstall packages installed with the pyversion removed from the egg-info metadata directory name. @@ -22,10 +27,17 @@ def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None: https://bitbucket.org/ianb/pip/issue/104/pip-uninstall-on-ubuntu-linux """ - result = script.pip("install", "INITools==0.2") + result = script.run( + "python", + "setup.py", + "install", + "--single-version-externally-managed", + f"--record={tmp_path / 'record'}", + cwd=shared_data.src / "simplewheel-2.0", + ) egg_info = os.path.join( - script.site_packages, f"INITools-0.2-py{pyversion}.egg-info" + script.site_packages, f"simplewheel-2.0-py{pyversion}.egg-info" ) # Debian only removes pyversion for global installs, not inside a venv @@ -35,7 +47,7 @@ def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None: result.did_create(egg_info, message=f"Couldn't find {egg_info}") # The Debian no-pyversion version of the .egg-info - mangled = os.path.join(script.site_packages, "INITools-0.2.egg-info") + mangled = os.path.join(script.site_packages, "simplewheel-2.0.egg-info") result.did_not_create(mangled, message=f"Found unexpected {mangled}") # Simulate a Debian install by copying the .egg-info to their name for it @@ -46,7 +58,7 @@ def test_debian_egg_name_workaround(script: PipTestEnvironment) -> None: assert os.path.isdir(full_mangled) # Try the uninstall and verify that everything is removed. - result2 = script.pip("uninstall", "INITools", "-y") + result2 = script.pip("uninstall", "simplewheel", "-y") assert_all_changes(result, result2, [script.venv / "build", "cache"]) |