MCPcopy
hub / github.com/pytest-dev/pytest / get_real_func

Function get_real_func

src/_pytest/compat.py:219–226  ·  view source on GitHub ↗

Get the real function object of the (possibly) wrapped object by :func:`functools.wraps`, or :func:`functools.partial`.

(obj)

Source from the content-addressed store, hash-verified

217
218
219def get_real_func(obj):
220 """Get the real function object of the (possibly) wrapped object by
221 :func:`functools.wraps`, or :func:`functools.partial`."""
222 obj = inspect.unwrap(obj)
223
224 if isinstance(obj, functools.partial):
225 obj = obj.func
226 return obj
227
228
229def getimfunc(func):

Callers 8

_traceback_filterMethod · 0.90
formatreprMethod · 0.90
getfslinenoFunction · 0.90
test_get_real_funcFunction · 0.90
getlocationFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_get_real_funcFunction · 0.72