MCPcopy Index your code
hub / github.com/python/cpython / test_auto_order_weird

Method test_auto_order_weird

Lib/test/test_enum.py:4890–4900  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4888 return name
4889
4890 def test_auto_order_weird(self):
4891 weird_auto = auto()
4892 weird_auto.value = 'pathological case'
4893 class Color(Enum):
4894 red = weird_auto
4895 def _generate_next_value_(name, start, count, last):
4896 return name
4897 blue = auto()
4898 self.assertEqual(list(Color), [Color.red, Color.blue])
4899 self.assertEqual(Color.red.value, 'pathological case')
4900 self.assertEqual(Color.blue.value, 'blue')
4901
4902 @unittest.skipIf(
4903 python_version < (3, 13),

Callers

nothing calls this directly

Calls 3

autoClass · 0.90
listClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected