mirror of https://github.com/python/cpython
gh-95591: [Enum] use `_FlagTests` base class (GH-96475)
This commit is contained in:
parent
a3e2f054d2
commit
9b58eaf98c
|
@ -777,7 +777,7 @@ class _FlagTests:
|
|||
def test_default_missing_with_wrong_type_value(self):
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
"'RED' is not a valid TestFlag.Color",
|
||||
"'RED' is not a valid ",
|
||||
) as ctx:
|
||||
self.MainEnum('RED')
|
||||
self.assertIs(ctx.exception.__context__, None)
|
||||
|
@ -786,7 +786,7 @@ class TestPlainEnum(_EnumTests, _PlainOutputTests, unittest.TestCase):
|
|||
enum_type = Enum
|
||||
|
||||
|
||||
class TestPlainFlag(_EnumTests, _PlainOutputTests, unittest.TestCase):
|
||||
class TestPlainFlag(_EnumTests, _PlainOutputTests, _FlagTests, unittest.TestCase):
|
||||
enum_type = Flag
|
||||
|
||||
|
||||
|
@ -798,7 +798,7 @@ class TestStrEnum(_EnumTests, _MinimalOutputTests, unittest.TestCase):
|
|||
enum_type = StrEnum
|
||||
|
||||
|
||||
class TestIntFlag(_EnumTests, _MinimalOutputTests, unittest.TestCase):
|
||||
class TestIntFlag(_EnumTests, _MinimalOutputTests, _FlagTests, unittest.TestCase):
|
||||
enum_type = IntFlag
|
||||
|
||||
|
||||
|
@ -810,7 +810,7 @@ class TestMixedStr(_EnumTests, _MixedOutputTests, unittest.TestCase):
|
|||
class enum_type(str, Enum): pass
|
||||
|
||||
|
||||
class TestMixedIntFlag(_EnumTests, _MixedOutputTests, unittest.TestCase):
|
||||
class TestMixedIntFlag(_EnumTests, _MixedOutputTests, _FlagTests, unittest.TestCase):
|
||||
class enum_type(int, Flag): pass
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue