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

Method test_pop

Lib/test/mapping_tests.py:582–599  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

580 self.assertIsInstance(ud, collections.UserDict)
581
582 def test_pop(self):
583 TestMappingProtocol.test_pop(self)
584
585 class Exc(Exception): pass
586
587 class BadHash(object):
588 fail = False
589 def __hash__(self):
590 if self.fail:
591 raise Exc()
592 else:
593 return 42
594
595 d = self._empty_mapping()
596 x = BadHash()
597 d[x] = 42
598 x.fail = True
599 self.assertRaises(Exc, d.pop, x)
600
601 def test_mutatingiteration(self):
602 d = self._empty_mapping()

Callers

nothing calls this directly

Calls 4

BadHashClass · 0.70
test_popMethod · 0.45
_empty_mappingMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected