bpo-46242: [Enum] better error message for extending Enum with members (GH-30357)

This commit is contained in:
Nikita Sobolev 2022-01-15 01:18:00 +03:00 committed by GitHub
parent 2402f1e1f8
commit e674e48ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View file

@ -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):