mirror of
https://github.com/python/cpython.git
synced 2025-10-28 12:15:13 +00:00
gh-93259: Validate arg to `Distribution.from_name`. (GH-94270)
Syncs with importlib_metadata 4.12.0.
This commit is contained in:
parent
9af6b75298
commit
38612a05b5
6 changed files with 135 additions and 67 deletions
|
|
@ -89,15 +89,15 @@ def test_entry_points_distribution(self):
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue