Skip to content

Commit

Permalink
Move test_interleaved_discovery from test_integration to test_main.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 8, 2023
1 parent 50e9f81 commit c10a5aa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 0 additions & 14 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from importlib_metadata import (
MetadataPathFinder,
_compat,
distributions,
version,
)

Expand Down Expand Up @@ -64,16 +63,3 @@ def test_search_dist_dirs(self):
"""
res = MetadataPathFinder._search_paths('any-name', [])
assert list(res) == []

def test_interleaved_discovery(self):
"""
When the search is cached, it is
possible for searches to be interleaved, so make sure
those use-cases are safe.
Ref #293
"""
dists = distributions()
next(dists)
version('importlib_metadata')
next(dists)
14 changes: 14 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ def test_invalid_usage(self):
with self.assertRaises(ValueError):
list(distributions(context='something', name='else'))

def test_interleaved_discovery(self):
"""
Ensure interleaved searches are safe.
When the search is cached, it is possible for searches to be
interleaved, so make sure those use-cases are safe.
Ref #293
"""
dists = distributions()
next(dists)
version('egginfo-pkg')
next(dists)


class DirectoryTest(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase):
def test_egg_info(self):
Expand Down

0 comments on commit c10a5aa

Please sign in to comment.