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

Method _check_weakref

Lib/test/test_copy.py:838–847  ·  view source on GitHub ↗
(self, _copy)

Source from the content-addressed store, hash-verified

836 self.assertEqual(copy.deepcopy(bar), bar)
837
838 def _check_weakref(self, _copy):
839 class C(object):
840 pass
841 obj = C()
842 x = weakref.ref(obj)
843 y = _copy(x)
844 self.assertIs(y, x)
845 del obj
846 y = _copy(x)
847 self.assertIs(y, x)
848
849 def test_copy_weakref(self):
850 self._check_weakref(copy.copy)

Callers 2

test_copy_weakrefMethod · 0.95
test_deepcopy_weakrefMethod · 0.95

Calls 3

_copyFunction · 0.85
CClass · 0.70
assertIsMethod · 0.45

Tested by

no test coverage detected