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

Method test_weak_keyed_delitem

Lib/test/test_weakref.py:1824–1833  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1822 d.update(k='v')
1823
1824 def test_weak_keyed_delitem(self):
1825 d = weakref.WeakKeyDictionary()
1826 o1 = Object('1')
1827 o2 = Object('2')
1828 d[o1] = 'something'
1829 d[o2] = 'something'
1830 self.assertEqual(len(d), 2)
1831 del d[o1]
1832 self.assertEqual(len(d), 1)
1833 self.assertEqual(list(d.keys()), [o2])
1834
1835 def test_weak_keyed_union_operators(self):
1836 o1 = C()

Callers

nothing calls this directly

Calls 4

keysMethod · 0.95
listClass · 0.85
ObjectClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected