From c10a5aa0d1f53ee318ed91d42afe730ddaaa3732 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Jun 2023 15:53:06 -0400 Subject: [PATCH] Move test_interleaved_discovery from test_integration to test_main. --- tests/test_integration.py | 14 -------------- tests/test_main.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) 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):