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

Method test_weakref

Lib/test/test_deque.py:864–870  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

862 self.assertRaises(TypeError, pickle.dumps, d, proto)
863
864 def test_weakref(self):
865 d = deque('gallahad')
866 p = weakref.proxy(d)
867 self.assertEqual(str(p), str(d))
868 d = None
869 support.gc_collect() # For PyPy or other GCs.
870 self.assertRaises(ReferenceError, str, p)
871
872 def test_strange_subclass(self):
873 class X(deque):

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
proxyMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected