MCPcopy Create free account
hub / github.com/pytest-dev/pytest / is_async_function

Function is_async_function

src/_pytest/compat.py:80–83  ·  view source on GitHub ↗

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

78
79
80def is_async_function(func: object) -> bool:
81 """Return True if the given function seems to be an async function or
82 an async generator."""
83 return iscoroutinefunction(func) or inspect.isasyncgenfunction(func)
84
85
86def getlocation(function, curdir: Optional[str] = None) -> str:

Callers 2

pytest_pyfunc_callFunction · 0.90
runtestMethod · 0.90

Calls 1

iscoroutinefunctionFunction · 0.85

Tested by 1

runtestMethod · 0.72