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

Function iscoroutinefunction

src/_pytest/compat.py:50–59  ·  view source on GitHub ↗

Return True if func is a coroutine function (a function defined with async def syntax, and doesn't contain yield), or a function decorated with @asyncio.coroutine. Note: copied and modified from Python 3.5's builtin coroutines.py to avoid importing asyncio directly, which in turns a

(func: object)

Source from the content-addressed store, hash-verified

48
49
50def iscoroutinefunction(func: object) -> bool:
51 """Return True if func is a coroutine function (a function defined with async
52 def syntax, and doesn't contain yield), or a function decorated with
53 @asyncio.coroutine.
54
55 Note: copied and modified from Python 3.5's builtin coroutines.py to avoid
56 importing asyncio directly, which in turns also initializes the "logging"
57 module as a side-effect (see issue #8).
58 """
59 return inspect.iscoroutinefunction(func) or getattr(func, "_is_coroutine", False)
60
61
62def is_async_function(func: object) -> bool:

Callers 1

is_async_functionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected