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

Method test_dict_missing

Lib/test/test_collections.py:76–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74 self._copy_test(obj)
75
76 def test_dict_missing(self):
77 class A(UserDict):
78 def __missing__(self, key):
79 return 456
80 self.assertEqual(A()[123], 456)
81 # get() ignores __missing__ on dict
82 self.assertIs(A().get(123), None)
83
84
85################################################################################

Callers

nothing calls this directly

Calls 4

AClass · 0.70
assertEqualMethod · 0.45
assertIsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected