]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Enum] add built-in property to test_test_simple_enum (GH-98453)
authorEthan Furman <ethan@stoneleaf.us>
Sun, 6 Nov 2022 20:03:42 +0000 (12:03 -0800)
committerGitHub <noreply@github.com>
Sun, 6 Nov 2022 20:03:42 +0000 (12:03 -0800)
Lib/test/test_enum.py

index 38b1d7c77146e0eae5b216bb9e8bbf01c502ec27..03a9c610a86d4c9d035775643dbf2ad6eb14584e 100644 (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(