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

Method test_extending3

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

Source from the content-addressed store, hash-verified

2580 yellow = 6
2581
2582 def test_extending3(self):
2583 class Shade(Enum):
2584 def shade(self):
2585 return self.name
2586 class Color(Shade):
2587 def hex(self):
2588 return '%s hexlified!' % self.value
2589 class MoreColor(Color):
2590 cyan = 4
2591 magenta = 5
2592 yellow = 6
2593 self.assertEqual(MoreColor.magenta.hex(), '5 hexlified!')
2594
2595 def test_subclass_duplicate_name(self):
2596 class Base(Enum):

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.45
hexMethod · 0.45

Tested by

no test coverage detected