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

Method test_callable

Lib/test/test_inspect/test_inspect.py:3302–3308  ·  view source on GitHub ↗

Use this to test bound methods or normal callables (things that don't expect self)

(o)

Source from the content-addressed store, hash-verified

3300 return signature
3301
3302 def test_callable(o):
3303 """Use this to test bound methods or normal callables (things that don't expect self)"""
3304 signature = inspect.signature(o)
3305 self.assertTrue(isinstance(signature, inspect.Signature))
3306 if signature.parameters:
3307 self.assertNotEqual(list(signature.parameters.values())[0].name, 'self')
3308 return signature
3309
3310 signature = test_callable(_testcapi.docstring_with_signature_with_defaults)
3311 def p(name): return signature.parameters[name].default

Callers

nothing calls this directly

Calls 5

listClass · 0.85
assertTrueMethod · 0.80
assertNotEqualMethod · 0.80
signatureMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected