[Enum] add built-in property to test_test_simple_enum (GH-98453)

This commit is contained in:
Ethan Furman 2022-11-06 12:03:42 -08:00 committed by GitHub
parent 8463cb55da
commit a71b117c3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -4376,10 +4376,16 @@ class TestStdLib(unittest.TestCase):
CYAN = 1
MAGENTA = 2
YELLOW = 3
@bltns.property
def zeroth(self):
return 'zeroed %s' % self.name
class CheckedColor(Enum):
CYAN = 1
MAGENTA = 2
YELLOW = 3
@bltns.property
def zeroth(self):
return 'zeroed %s' % self.name
self.assertTrue(_test_simple_enum(CheckedColor, SimpleColor) is None)
SimpleColor.MAGENTA._value_ = 9
self.assertRaisesRegex(