diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2022-08-30 19:39:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 19:39:03 (GMT) |
commit | 8f58db2279a97d826e5bfa99627ba9bb66f6f096 (patch) | |
tree | f60d82a8a7911efd16e5256ded91a06c954bd556 /Lib/test/test_enum.py | |
parent | d00a9e0176e9a1e2dd213a137757da36e071bd81 (diff) | |
download | cpython-8f58db2279a97d826e5bfa99627ba9bb66f6f096.zip cpython-8f58db2279a97d826e5bfa99627ba9bb66f6f096.tar.gz cpython-8f58db2279a97d826e5bfa99627ba9bb66f6f096.tar.bz2 |
[3.11] [Enum] fix check in _test_simple_enum (GH-96435)
The builtin `property` is not a callable, so was failing the check in
`_test_simple_enum` causing a match failure; this adds `property` to the
bypass list.
Co-authored-by: Alexandru Mărășteanu <alexei@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_enum.py')
-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 4a42c73..7964d3e 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -4337,10 +4337,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( |