From fd118a0850b62887c379577cd9bdf23a4f0e2ba6 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 20 Sep 2022 16:34:14 -0700 Subject: [PATCH] gh-95591: [Enum] use `_FlagTests` base class (GH-96475) (cherry picked from commit 9b58eaf98c0a47235c8822e208c938a36b66ff7b) Co-authored-by: Nikita Sobolev --- Lib/test/test_enum.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 7964d3e474c..3b1c77d688e 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -764,7 +764,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) @@ -773,7 +773,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 @@ -785,7 +785,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 @@ -797,7 +797,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