summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStéphane Bidoul <stephane.bidoul@gmail.com>2023-03-18 18:46:22 +0100
committerStéphane Bidoul <stephane.bidoul@gmail.com>2023-03-31 09:47:09 +0200
commit0060bfa7e395d0b1a588e8c63f350356ce12a664 (patch)
tree8fedbea2e1ade0124bb19e4ace1d0deabdaf93b8 /tests
parent64967c79072e908510e0627d8571ae920337e43f (diff)
downloadpip-0060bfa7e395d0b1a588e8c63f350356ce12a664.tar.gz
Rework test_show_with_files_from_legacy
It relied on a function that does not exist anymore.
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/test_show.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/functional/test_show.py b/tests/functional/test_show.py
index 3361eb3ec..b8ec0510a 100644
--- a/tests/functional/test_show.py
+++ b/tests/functional/test_show.py
@@ -1,11 +1,17 @@
import os
import pathlib
import re
+import textwrap
from pip import __version__
from pip._internal.commands.show import search_packages_info
from pip._internal.utils.unpacking import untar_file
-from tests.lib import PipTestEnvironment, TestData, create_test_package_with_setup
+from tests.lib import (
+ PipTestEnvironment,
+ TestData,
+ create_test_package_with_setup,
+ pyversion,
+)
def test_basic_show(script: PipTestEnvironment) -> None:
@@ -74,10 +80,19 @@ def test_show_with_files_from_legacy(
str(setuptools_record),
cwd=source_dir,
)
- write_installed_files_from_setuptools_record(
- setuptools_record.read_text().splitlines(),
- root=None,
- req_description="simple==1.0",
+ # Emulate the installed-files.txt generation which previous pip version did
+ # after running setup.py install (write_installed_files_from_setuptools_record).
+ egg_info_dir = script.site_packages_path / f"simple-1.0-py{pyversion}.egg-info"
+ egg_info_dir.joinpath("installed-files.txt").write_text(
+ textwrap.dedent(
+ """\
+ ../simple/__init__.py
+ PKG-INFO
+ SOURCES.txt
+ dependency_links.txt
+ top_level.txt
+ """
+ )
)
result = script.pip("show", "--files", "simple")