From 1a1628819779110854d4e1ab490db2cab80e26b4 Mon Sep 17 00:00:00 2001 From: Ethan Furman Date: Wed, 16 Oct 2013 19:09:31 -0700 Subject: [PATCH] Close #19252: better test coverage for Enum. Thanks, CliffM --- Lib/test/test_enum.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 3d962f9688e..77477dfb654 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1139,8 +1139,10 @@ class TestEnum(unittest.TestCase): green = () blue = () self.assertEqual(list(ColorInAList), [ColorInAList.red, ColorInAList.green, ColorInAList.blue]) - self.assertEqual(ColorInAList.red.value, [1]) - self.assertEqual(ColorInAList([1]), ColorInAList.red) + for enum, value in zip(ColorInAList, range(3)): + value += 1 + self.assertEqual(enum.value, [value]) + self.assertIs(ColorInAList([value]), enum) def test_conflicting_types_resolved_in_new(self): class LabelledIntEnum(int, Enum):