diff options
author | Arie Bovenberg <a.c.bovenberg@gmail.com> | 2022-02-11 01:56:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 16:56:21 -0800 |
commit | dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d (patch) | |
tree | f4b5f5b219371a356498beb9b42978f3eb5a6bfa /Lib/test/test_importlib/test_metadata_api.py | |
parent | 80e4f262aa27a39abf3fadc19a6323fea4607a8f (diff) | |
download | cpython-dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d.tar.gz cpython-dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d.zip |
bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)
Confirmed with @jaraco that this indeed needs a fix.
A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own.
Automerge-Triggered-By: GH:jaraco
Diffstat (limited to 'Lib/test/test_importlib/test_metadata_api.py')
-rw-r--r-- | Lib/test/test_importlib/test_metadata_api.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index e16773a7e87..78287c314ce 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++ b/Lib/test/test_importlib/test_metadata_api.py @@ -172,6 +172,11 @@ class APITests( entry_points().get('entries', 'default') == entry_points()['entries'] entry_points().get('missing', ()) == () + def test_entry_points_allows_no_attributes(self): + ep = entry_points().select(group='entries', name='main') + with self.assertRaises(AttributeError): + ep.foo = 4 + def test_metadata_for_this_package(self): md = metadata('egginfo-pkg') assert md['author'] == 'Steven Ma' |