From 7a5e025f51e88cf49092fb33e2cb5bea82dc7ff5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 18 Jun 2023 16:46:33 -0400 Subject: [PATCH] Streamline the test to check one expectation (the standard dist-info expectation is handled by other tests above. --- tests/test_main.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tests/test_main.py b/tests/test_main.py index 5d3f39c6..5f653f3d 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -401,29 +401,15 @@ def test_packages_distributions_all_module_types(self): class PackagesDistributionsDistTest( - fixtures.DistInfoPkg, fixtures.DistInfoSymlinkedPkg, unittest.TestCase, ): - def test_packages_distributions_on_dist_info(self): + def test_packages_distributions_symlinked_top_level(self): """ - Test _top_level_inferred() on various dist-info packages. + Distribution is resolvable from a simple top-level symlink in RECORD. + See #452. """ - distributions = packages_distributions() - - def import_names_from_package(package_name): - return { - import_name - for import_name, package_names in distributions.items() - if package_name in package_names - } - - # distinfo-pkg has one import ('mod') inferred from RECORD - assert import_names_from_package('distinfo-pkg') == {'mod'} - - # symlinked-pkg has one import ('symlinked') inderred from RECORD which - # references a symlink to the real package dir elsewhere. - assert import_names_from_package('symlinked-pkg') == {'symlinked'} + assert packages_distributions()['symlinked'] == ['symlinked-pkg'] class PackagesDistributionsEggTest(