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

Method test_set_callback_attribute

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

Source from the content-addressed store, hash-verified

1005 self.assertIsNone(ref.__callback__)
1006
1007 def test_set_callback_attribute(self):
1008 x = Object(1)
1009 callback = lambda ref: None
1010 ref1 = weakref.ref(x, callback)
1011 with self.assertRaises(AttributeError):
1012 ref1.__callback__ = lambda ref: None
1013
1014 def test_callback_gcs(self):
1015 class ObjectWithDel(Object):

Callers

nothing calls this directly

Calls 2

ObjectClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected