diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-16 15:49:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-16 15:49:42 -0500 |
| commit | 04deaee4c8d313717f3ea8f6a4fd70286d510d6e (patch) | |
| tree | 16af6d5242d248eb93107332099485783599fd4b /Lib/test/test_importlib/test_metadata_api.py | |
| parent | 109d96602199a91e94eb14b8cb3720841f22ded7 (diff) | |
| download | cpython-git-04deaee4c8d313717f3ea8f6a4fd70286d510d6e.tar.gz | |
bpo-44893: Implement EntryPoint as simple class with attributes. (GH-30150)
* bpo-44893: Implement EntryPoint as simple class and deprecate tuple access in favor of attribute access. Syncs with importlib_metadata 4.8.1.
* Apply refactorings found in importlib_metadata 4.8.2.
Diffstat (limited to 'Lib/test/test_importlib/test_metadata_api.py')
| -rw-r--r-- | Lib/test/test_importlib/test_metadata_api.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index 4a45312e31..e16773a7e8 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++ b/Lib/test/test_importlib/test_metadata_api.py @@ -21,7 +21,7 @@ from importlib.metadata import ( @contextlib.contextmanager def suppress_known_deprecation(): with warnings.catch_warnings(record=True) as ctx: - warnings.simplefilter('default') + warnings.simplefilter('default', category=DeprecationWarning) yield ctx @@ -113,7 +113,7 @@ class APITests( for ep in entries ) # ns:sub doesn't exist in alt_pkg - assert 'ns:sub' not in entries + assert 'ns:sub' not in entries.names def test_entry_points_missing_name(self): with self.assertRaises(KeyError): @@ -194,10 +194,8 @@ class APITests( file.read_text() def test_file_hash_repr(self): - assertRegex = self.assertRegex - util = [p for p in files('distinfo-pkg') if p.name == 'mod.py'][0] - assertRegex(repr(util.hash), '<FileHash mode: sha256 value: .*>') + self.assertRegex(repr(util.hash), '<FileHash mode: sha256 value: .*>') def test_files_dist_info(self): self._test_files(files('distinfo-pkg')) |
