[3.11] gh-98706: Sync with importlib_metadata 4.13.0. (GH-98875)

These changes are already applied to main but have been selected from importlib_metadata 4.x for their bug fixes.
This commit is contained in:
Jason R. Coombs 2022-11-05 09:55:04 -04:00 committed by GitHub
parent 46a493e2db
commit 07734a42db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 209 additions and 93 deletions

View file

@ -89,15 +89,15 @@ class APITests(
self.assertIn(ep.dist.name, ('distinfo-pkg', 'egginfo-pkg'))
self.assertEqual(ep.dist.version, "1.0.0")
def test_entry_points_unique_packages(self):
def test_entry_points_unique_packages_normalized(self):
"""
Entry points should only be exposed for the first package
on sys.path with a given name.
on sys.path with a given name (even when normalized).
"""
alt_site_dir = self.fixtures.enter_context(fixtures.tempdir())
self.fixtures.enter_context(self.add_sys_path(alt_site_dir))
alt_pkg = {
"distinfo_pkg-1.1.0.dist-info": {
"DistInfo_pkg-1.1.0.dist-info": {
"METADATA": """
Name: distinfo-pkg
Version: 1.1.0