Skip to content

gh-95591: enum: _FlagTests were never run #96475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/test/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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


Expand All @@ -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


Expand All @@ -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


Expand Down