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

Method test_keyerror_without_factory

Lib/test/test_defaultdict.py:119–126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

117 self.assertEqual(d2, d1)
118
119 def test_keyerror_without_factory(self):
120 d1 = defaultdict()
121 try:
122 d1[(1,)]
123 except KeyError as err:
124 self.assertEqual(err.args[0], (1,))
125 else:
126 self.fail("expected KeyError")
127
128 def test_recursive_repr(self):
129 # Issue2045: stack overflow when default_factory is a bound method

Callers

nothing calls this directly

Calls 3

defaultdictClass · 0.85
assertEqualMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected