Skip to content

Commit ed7dbe9

Browse files
fix formatting
1 parent 5306407 commit ed7dbe9

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

src/pip/_internal/req/req_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __str__(self) -> str:
198198
if self.satisfied_by.location is not None:
199199
location = display_path(self.satisfied_by.location)
200200
else:
201-
location = 'memory'
201+
location = "<memory>"
202202
s += f" in {location}"
203203
if self.comes_from:
204204
if isinstance(self.comes_from, str):

tests/functional/test_install.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,44 +2355,41 @@ def test_install_8559_wheel_package_present(
23552355

23562356
@pytest.mark.skipif(
23572357
sys.version_info < (3, 11),
2358-
reason="3.11 required to find distributions via importlib metadata"
2358+
reason="3.11 required to find distributions via importlib metadata",
23592359
)
23602360
def test_install_existing_memory_distribution(script: PipTestEnvironment):
23612361
sitecustomize_text = textwrap.dedent(
23622362
"""
23632363
import sys
23642364
from importlib.metadata import Distribution, DistributionFinder
2365-
2366-
2365+
2366+
23672367
EXAMPLE_METADATA = '''Metadata-Version: 2.1
23682368
Name: example
23692369
Version: 1.0.0
2370-
2370+
23712371
'''
23722372
23732373
class ExampleDistribution(Distribution):
23742374
def locate_file(self, path):
23752375
return path
2376-
2376+
23772377
def read_text(self, filename):
23782378
if filename == 'METADATA':
23792379
return EXAMPLE_METADATA
2380-
2381-
2380+
2381+
23822382
class CustomFinder(DistributionFinder):
23832383
def find_distributions(self, context=None):
23842384
return [ExampleDistribution()]
2385-
2386-
2385+
2386+
23872387
sys.meta_path.append(CustomFinder())
23882388
"""
23892389
)
2390-
with open(script.site_packages_path / 'sitecustomize.py', 'w') as sitecustomize_file:
2391-
sitecustomize_file.write(sitecustomize_text)
2390+
with open(script.site_packages_path / "sitecustomize.py", "w") as sitecustomize:
2391+
sitecustomize.write(sitecustomize_text)
23922392

2393-
result = script.pip(
2394-
"install",
2395-
"example"
2396-
)
2393+
result = script.pip("install", "example")
23972394

23982395
assert "Requirement already satisfied: example in <memory>" in result.stdout

0 commit comments

Comments
 (0)