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

Method test_no_such_enum_member

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

Source from the content-addressed store, hash-verified

2029 self.assertIs(Plain._member_type_, object)
2030
2031 def test_no_such_enum_member(self):
2032 class Color(Enum):
2033 red = 1
2034 green = 2
2035 blue = 3
2036 with self.assertRaises(ValueError):
2037 Color(4)
2038 with self.assertRaises(KeyError):
2039 Color['chartreuse']
2040
2041 # tests that need to be evalualted for moving
2042

Callers

nothing calls this directly

Calls 2

ColorClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected