diff --git a/tests/test_integration.py b/tests/test_integration.py index 7d0c13cc..5258bada 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -15,7 +15,6 @@ from importlib_metadata import ( MetadataPathFinder, _compat, - distributions, version, ) @@ -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) diff --git a/tests/test_main.py b/tests/test_main.py index 6eefe92b..ad007595 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -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):