MCPcopy Create free account
hub / github.com/python/cpython / test_override_update

Method test_override_update

Lib/test/test_ordered_dict.py:484–491  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

482 self.assertEqual(od.items(), dict(od).items())
483
484 def test_override_update(self):
485 OrderedDict = self.OrderedDict
486 # Verify that subclasses can override update() without breaking __init__()
487 class MyOD(OrderedDict):
488 def update(self, *args, **kwds):
489 raise Exception()
490 items = [('a', 1), ('c', 3), ('b', 2)]
491 self.assertEqual(list(MyOD(items).items()), items)
492
493 def test_highly_nested(self):
494 # Issues 25395 and 35983: test that the trashcan mechanism works

Callers

nothing calls this directly

Calls 4

listClass · 0.85
MyODClass · 0.85
assertEqualMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected