mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-93910: [Enum] remove member.member deprecation (GH-103236) (GH-103299)
i.e. Color.RED.BLUE is now officially supported..
(cherry picked from commit 4ec8dd10bd
)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
This commit is contained in:
parent
0291397c57
commit
58e330ac9c
4 changed files with 36 additions and 42 deletions
|
@ -2621,14 +2621,15 @@ 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):
|
||||
YES = 1
|
||||
NO = 0
|
||||
nope = Di.YES.NO
|
||||
|
||||
def test_member_from_member_access(self):
|
||||
class Di(Enum):
|
||||
YES = 1
|
||||
NO = 0
|
||||
name = 3
|
||||
warn = Di.YES.NO
|
||||
self.assertIs(warn, Di.NO)
|
||||
self.assertIs(Di.name, Di['name'])
|
||||
self.assertEqual(Di.name.name, 'name')
|
||||
|
||||
def test_dynamic_members_with_static_methods(self):
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue