diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2022-11-06 20:03:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-06 20:03:42 (GMT) |
commit | a71b117c3d4e4828057970706d03c2dad8f67c1f (patch) | |
tree | 4d71845e8ea29ab199f63c66a4febf76c25e3550 | |
parent | 8463cb55dabb78571e32d8c8c7de8679ab421c2c (diff) | |
download | cpython-a71b117c3d4e4828057970706d03c2dad8f67c1f.zip cpython-a71b117c3d4e4828057970706d03c2dad8f67c1f.tar.gz cpython-a71b117c3d4e4828057970706d03c2dad8f67c1f.tar.bz2 |
[Enum] add built-in property to test_test_simple_enum (GH-98453)
-rw-r--r-- | Lib/test/test_enum.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 38b1d7c..03a9c61 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -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( |