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

Method test_pop

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

Source from the content-addressed store, hash-verified

298 self.assertRaises(TypeError, d.popitem, 42)
299
300 def test_pop(self):
301 d = self._empty_mapping()
302 k, v = list(self.inmapping.items())[0]
303 d[k] = v
304 self.assertRaises(KeyError, d.pop, list(self.other.keys())[0])
305
306 self.assertEqual(d.pop(k), v)
307 self.assertEqual(len(d), 0)
308
309 self.assertRaises(KeyError, d.pop, k)
310
311
312class TestMappingProtocol(BasicTestMappingProtocol):

Callers

nothing calls this directly

Calls 7

listClass · 0.85
_empty_mappingMethod · 0.45
itemsMethod · 0.45
assertRaisesMethod · 0.45
keysMethod · 0.45
assertEqualMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected