Skip to content

Commit c066e68

Browse files
committed
Add test ensuring MetadataPathFinder._search_paths is available for PyPA projects. Fixes #111.
1 parent cbb4583 commit c066e68

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ v3.4.0
44
* #10: Project now declares itself as being typed.
55
* #272: Additional performance enhancements to distribution
66
discovery.
7+
* #111: For PyPA projects, add test ensuring that
8+
``MetadataPathFinder._search_paths`` honors the needed
9+
interface. Method is still private.
710

811
v3.3.0
912
======

tests/test_integration.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from . import fixtures
66
from importlib_metadata import (
77
Distribution,
8+
MetadataPathFinder,
89
_compat,
910
version,
1011
)
@@ -47,3 +48,14 @@ def test_find_local(self):
4748
dist = Distribution._local()
4849
assert dist.metadata['Name'] == 'local-pkg'
4950
assert dist.version == '2.0.1'
51+
52+
53+
class DistSearch(unittest.TestCase):
54+
def test_search_dist_dirs(self):
55+
"""
56+
Pip needs the _search_paths interface to locate
57+
distribution metadata dirs. Protect it for PyPA
58+
use-cases (only). Ref python/importlib_metadata#111.
59+
"""
60+
res = MetadataPathFinder._search_paths('any-name', [])
61+
assert list(res) == []

0 commit comments

Comments
 (0)