Skip to content

Commit

Permalink
Add test ensuring MetadataPathFinder._search_paths is available for P…
Browse files Browse the repository at this point in the history
…yPA projects. Fixes #111.
  • Loading branch information
jaraco committed Jan 10, 2021
1 parent cbb4583 commit c066e68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ v3.4.0
* #10: Project now declares itself as being typed.
* #272: Additional performance enhancements to distribution
discovery.
* #111: For PyPA projects, add test ensuring that
``MetadataPathFinder._search_paths`` honors the needed
interface. Method is still private.

v3.3.0
======
Expand Down
12 changes: 12 additions & 0 deletions tests/test_integration.py
Expand Up @@ -5,6 +5,7 @@
from . import fixtures
from importlib_metadata import (
Distribution,
MetadataPathFinder,
_compat,
version,
)
Expand Down Expand Up @@ -47,3 +48,14 @@ def test_find_local(self):
dist = Distribution._local()
assert dist.metadata['Name'] == 'local-pkg'
assert dist.version == '2.0.1'


class DistSearch(unittest.TestCase):
def test_search_dist_dirs(self):
"""
Pip needs the _search_paths interface to locate
distribution metadata dirs. Protect it for PyPA
use-cases (only). Ref python/importlib_metadata#111.
"""
res = MetadataPathFinder._search_paths('any-name', [])
assert list(res) == []

0 comments on commit c066e68

Please sign in to comment.