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

Method test_missing

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

Source from the content-addressed store, hash-verified

48 self.assertRaises(TypeError, defaultdict, 1)
49
50 def test_missing(self):
51 d1 = defaultdict()
52 self.assertRaises(KeyError, d1.__missing__, 42)
53 d1.default_factory = list
54 self.assertEqual(d1.__missing__(42), [])
55
56 def test_repr(self):
57 d1 = defaultdict()

Callers

nothing calls this directly

Calls 4

defaultdictClass · 0.85
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
__missing__Method · 0.45

Tested by

no test coverage detected