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

Method check_basic_ref

Lib/test/test_weakref.py:249–256  ·  view source on GitHub ↗
(self, factory)

Source from the content-addressed store, hash-verified

247 rf'<weakproxy at 0x[0-9a-fA-F]+; dead>')
248
249 def check_basic_ref(self, factory):
250 o = factory()
251 ref = weakref.ref(o)
252 self.assertIsNotNone(ref(),
253 "weak reference to live object should be live")
254 o2 = ref()
255 self.assertIs(o, o2,
256 "<ref>() should return original object if live")
257
258 def check_basic_callback(self, factory):
259 self.cbcalled = 0

Callers 2

test_basic_refMethod · 0.95
test_cfunctionMethod · 0.95

Calls 3

assertIsNotNoneMethod · 0.80
factoryFunction · 0.50
assertIsMethod · 0.45

Tested by

no test coverage detected