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

Method test_make_weak_valued_dict_misc

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

Source from the content-addressed store, hash-verified

1670 self.assertEqual(dict[364], o)
1671
1672 def test_make_weak_valued_dict_misc(self):
1673 # errors
1674 self.assertRaises(TypeError, weakref.WeakValueDictionary.__init__)
1675 self.assertRaises(TypeError, weakref.WeakValueDictionary, {}, {})
1676 self.assertRaises(TypeError, weakref.WeakValueDictionary, (), ())
1677 # special keyword arguments
1678 o = Object(3)
1679 for kw in 'self', 'dict', 'other', 'iterable':
1680 d = weakref.WeakValueDictionary(**{kw: o})
1681 self.assertEqual(list(d.keys()), [kw])
1682 self.assertEqual(d[kw], o)
1683
1684 def make_weak_valued_dict(self):
1685 dict = weakref.WeakValueDictionary()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected