mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-46242: [Enum] better error message for extending Enum
with members (GH-30357)
This commit is contained in:
parent
2402f1e1f8
commit
e674e48ddc
3 changed files with 7 additions and 5 deletions
|
@ -1433,6 +1433,8 @@ class TestEnum(unittest.TestCase):
|
|||
with self.assertRaisesRegex(TypeError, "EvenMoreColor: cannot extend enumeration 'Color'"):
|
||||
class EvenMoreColor(Color, IntEnum):
|
||||
chartruese = 7
|
||||
with self.assertRaisesRegex(TypeError, "Foo: cannot extend enumeration 'Color'"):
|
||||
Color('Foo', ('pink', 'black'))
|
||||
|
||||
def test_exclude_methods(self):
|
||||
class whatever(Enum):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue