summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-09-17 00:28:32 (GMT)
committerGitHub <noreply@github.com>2020-09-17 00:28:32 (GMT)
commit007eddad3b809e1555391dc7e8168918933b6184 (patch)
treeb2125194e5c981cec0d568fbe1317e8c88f05050 /Lib/test
parent3f4012117bf80aa7c005f8fa6fb8e1f8b1aef5d5 (diff)
downloadcpython-007eddad3b809e1555391dc7e8168918933b6184.zip
cpython-007eddad3b809e1555391dc7e8168918933b6184.tar.gz
cpython-007eddad3b809e1555391dc7e8168918933b6184.tar.bz2
_auto_called cleanup (GH-22285)
(cherry picked from commit fc23a9483ef0d7c98bea9f82392377d0b6ef7b18) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
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 11e88db..daa44ae 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -1815,6 +1815,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):