Skip to content

Commit c10a5aa

Browse files
committed
Move test_interleaved_discovery from test_integration to test_main.
1 parent 50e9f81 commit c10a5aa

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

tests/test_integration.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from importlib_metadata import (
1616
MetadataPathFinder,
1717
_compat,
18-
distributions,
1918
version,
2019
)
2120

@@ -64,16 +63,3 @@ def test_search_dist_dirs(self):
6463
"""
6564
res = MetadataPathFinder._search_paths('any-name', [])
6665
assert list(res) == []
67-
68-
def test_interleaved_discovery(self):
69-
"""
70-
When the search is cached, it is
71-
possible for searches to be interleaved, so make sure
72-
those use-cases are safe.
73-
74-
Ref #293
75-
"""
76-
dists = distributions()
77-
next(dists)
78-
version('importlib_metadata')
79-
next(dists)

tests/test_main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,20 @@ def test_invalid_usage(self):
204204
with self.assertRaises(ValueError):
205205
list(distributions(context='something', name='else'))
206206

207+
def test_interleaved_discovery(self):
208+
"""
209+
Ensure interleaved searches are safe.
210+
211+
When the search is cached, it is possible for searches to be
212+
interleaved, so make sure those use-cases are safe.
213+
214+
Ref #293
215+
"""
216+
dists = distributions()
217+
next(dists)
218+
version('egginfo-pkg')
219+
next(dists)
220+
207221

208222
class DirectoryTest(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase):
209223
def test_egg_info(self):

0 commit comments

Comments
 (0)