summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2020-09-16 19:37:54 (GMT)
committerGitHub <noreply@github.com>2020-09-16 19:37:54 (GMT)
commitfc23a9483ef0d7c98bea9f82392377d0b6ef7b18 (patch)
treefb5c21a985ebddae10298469658fe037aceaa86e /Lib/test
parenta5634c406767ef694df49b624adf9cfa6c0d9064 (diff)
downloadcpython-fc23a9483ef0d7c98bea9f82392377d0b6ef7b18.zip
cpython-fc23a9483ef0d7c98bea9f82392377d0b6ef7b18.tar.gz
cpython-fc23a9483ef0d7c98bea9f82392377d0b6ef7b18.tar.bz2
_auto_called cleanup (GH-22285)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_enum.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 5d72d82..ebf7604 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -1837,6 +1837,17 @@ class TestEnum(unittest.TestCase):
def _generate_next_value_(name, start, count, last):
return name
+ def test_auto_order_wierd(self):
+ weird_auto = auto()
+ weird_auto.value = 'pathological case'
+ class Color(Enum):
+ red = weird_auto
+ def _generate_next_value_(name, start, count, last):
+ return name
+ blue = auto()
+ self.assertEqual(list(Color), [Color.red, Color.blue])
+ self.assertEqual(Color.red.value, 'pathological case')
+ self.assertEqual(Color.blue.value, 'blue')
def test_duplicate_auto(self):
class Dupes(Enum):