Skip to content

Commit

Permalink
Streamline the test to check one expectation (the standard dist-info …
Browse files Browse the repository at this point in the history
…expectation is handled by other tests above.
  • Loading branch information
jaraco committed Jun 18, 2023
1 parent 67662d8 commit 7a5e025
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7a5e025

Please sign in to comment.