Skip to content

Commit 10a87ad

Browse files
committed
Rework test_show_with_files_from_legacy
It relied on a function that does not exist anymore.
1 parent 3865b81 commit 10a87ad

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

tests/functional/test_show.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import os
22
import pathlib
33
import re
4+
import textwrap
45

56
from pip import __version__
67
from pip._internal.commands.show import search_packages_info
78
from pip._internal.utils.unpacking import untar_file
8-
from tests.lib import PipTestEnvironment, TestData, create_test_package_with_setup
9+
from tests.lib import (
10+
PipTestEnvironment,
11+
TestData,
12+
create_test_package_with_setup,
13+
pyversion,
14+
)
915

1016

1117
def test_basic_show(script: PipTestEnvironment) -> None:
@@ -74,10 +80,19 @@ def test_show_with_files_from_legacy(
7480
str(setuptools_record),
7581
cwd=source_dir,
7682
)
77-
write_installed_files_from_setuptools_record(
78-
setuptools_record.read_text().splitlines(),
79-
root=None,
80-
req_description="simple==1.0",
83+
# Emulate the installed-files.txt generation which previous pip version did
84+
# after running setup.py install (write_installed_files_from_setuptools_record).
85+
egg_info_dir = script.site_packages_path / f"simple-1.0-py{pyversion}.egg-info"
86+
egg_info_dir.joinpath("installed-files.txt").write_text(
87+
textwrap.dedent(
88+
"""\
89+
../simple/__init__.py
90+
PKG-INFO
91+
SOURCES.txt
92+
dependency_links.txt
93+
top_level.txt
94+
"""
95+
)
8196
)
8297

8398
result = script.pip("show", "--files", "simple")

0 commit comments

Comments
 (0)