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

Method test_cfunction

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

Source from the content-addressed store, hash-verified

169
170 @support.cpython_only
171 def test_cfunction(self):
172 _testcapi = import_helper.import_module("_testcapi")
173 create_cfunction = _testcapi.create_cfunction
174 f = create_cfunction()
175 wr = weakref.ref(f)
176 self.assertIs(wr(), f)
177 del f
178 self.assertIsNone(wr())
179 self.check_basic_ref(create_cfunction)
180 self.check_basic_callback(create_cfunction)
181
182 def test_multiple_callbacks(self):
183 o = C()

Callers

nothing calls this directly

Calls 5

check_basic_refMethod · 0.95
check_basic_callbackMethod · 0.95
assertIsNoneMethod · 0.80
import_moduleMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected