summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_enum.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-17 04:53:41 (GMT)
committerGitHub <noreply@github.com>2022-07-17 04:53:41 (GMT)
commit30f28ac296e506b336e0ab56c41422a53c36d0c2 (patch)
tree80e2ebe514ff3654a5a100b0ba11faf0fb6ba4fb /Lib/test/test_enum.py
parent5a34287b5dc75293bea02489feda22b4b6b28e3e (diff)
downloadcpython-30f28ac296e506b336e0ab56c41422a53c36d0c2.zip
cpython-30f28ac296e506b336e0ab56c41422a53c36d0c2.tar.gz
cpython-30f28ac296e506b336e0ab56c41422a53c36d0c2.tar.bz2
gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)
(cherry picked from commit c20186c3972ff38577c4c5e32ca86748210983d2) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Diffstat (limited to 'Lib/test/test_enum.py')
-rw-r--r--Lib/test/test_enum.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index f9a6627..74f31be 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -2611,7 +2611,6 @@ class TestSpecial(unittest.TestCase):
self.assertEqual(Private._Private__corporal, 'Radar')
self.assertEqual(Private._Private__major_, 'Hoolihan')
- @unittest.skip("Accessing all values retained for performance reasons, see GH-93910")
def test_exception_for_member_from_member_access(self):
with self.assertRaisesRegex(AttributeError, "<enum .Di.> member has no attribute .NO."):
class Di(Enum):
@@ -2619,6 +2618,12 @@ class TestSpecial(unittest.TestCase):
NO = 0
nope = Di.YES.NO
+ def test_no_exception_for_overridden_member_from_member_access(self):
+ class Di(Enum):
+ YES = 1
+ NO = 0
+ Di.YES.NO = Di.NO
+ nope = Di.YES.NO
def test_dynamic_members_with_static_methods(self):
#