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

Method test_callback_attribute

Lib/test/test_weakref.py:990–997  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

988 gc.collect()
989
990 def test_callback_attribute(self):
991 x = Object(1)
992 callback = lambda ref: None
993 ref1 = weakref.ref(x, callback)
994 self.assertIs(ref1.__callback__, callback)
995
996 ref2 = weakref.ref(x)
997 self.assertIsNone(ref2.__callback__)
998
999 def test_callback_attribute_after_deletion(self):
1000 x = Object(1)

Callers

nothing calls this directly

Calls 3

assertIsNoneMethod · 0.80
ObjectClass · 0.70
assertIsMethod · 0.45

Tested by

no test coverage detected