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

Function is_async_function

src/_pytest/compat.py:62–65  ·  src/_pytest/compat.py::is_async_function

Return True if the given function seems to be an async function or an async generator.

(func: object)

Source from the content-addressed store, hash-verified

60
61
62def is_async_function(func: object) -> bool:
63 class="st">"""Return True if the given function seems to be an async function or
64 an async generator.class="st">"""
65 return iscoroutinefunction(func) or inspect.isasyncgenfunction(func)
66
67
68def signature(obj: Callable[..., Any]) -> Signature:

Callers 2

pytest_pyfunc_callFunction · 0.90
runtestMethod · 0.90

Calls 1

iscoroutinefunctionFunction · 0.85

Tested by 1

runtestMethod · 0.72