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

Method check_shared_without_callback

Lib/test/test_weakref.py:388–404  ·  view source on GitHub ↗
(self, makeref)

Source from the content-addressed store, hash-verified

386 self.check_shared_without_callback(weakref.proxy)
387
388 def check_shared_without_callback(self, makeref):
389 o = Object(1)
390 p1 = makeref(o, None)
391 p2 = makeref(o, None)
392 self.assertIs(p1, p2, "both callbacks were None in the C API")
393 del p1, p2
394 p1 = makeref(o)
395 p2 = makeref(o, None)
396 self.assertIs(p1, p2, "callbacks were NULL, None in the C API")
397 del p1, p2
398 p1 = makeref(o)
399 p2 = makeref(o)
400 self.assertIs(p1, p2, "both callbacks were NULL in the C API")
401 del p1, p2
402 p1 = makeref(o, None)
403 p2 = makeref(o)
404 self.assertIs(p1, p2, "callbacks were None, NULL in the C API")
405
406 def test_callable_proxy(self):
407 o = Callable()

Calls 2

ObjectClass · 0.70
assertIsMethod · 0.45

Tested by

no test coverage detected