MCPcopy Create free account
hub / github.com/RustPython/RustPython / _check_weakref

Method _check_weakref

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

Source from the content-addressed store, hash-verified

806 self.assertEqual(copy.deepcopy(bar), bar)
807
808 def _check_weakref(self, _copy):
809 class C(object):
810 pass
811 obj = C()
812 x = weakref.ref(obj)
813 y = _copy(x)
814 self.assertIs(y, x)
815 del obj
816 y = _copy(x)
817 self.assertIs(y, x)
818
819 def test_copy_weakref(self):
820 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