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

Function async_warn_and_skip

src/_pytest/python.py:171–182  ·  view source on GitHub ↗
(nodeid: str)

Source from the content-addressed store, hash-verified

169
170
171def async_warn_and_skip(nodeid: str) -> None:
172 msg = "async def functions are not natively supported and have been skipped.\n"
173 msg += (
174 "You need to install a suitable plugin for your async framework, for example:\n"
175 )
176 msg += " - anyio\n"
177 msg += " - pytest-asyncio\n"
178 msg += " - pytest-tornasync\n"
179 msg += " - pytest-trio\n"
180 msg += " - pytest-twisted"
181 warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))
182 skip(reason="async def function and no async plugin installed (see warnings)")
183
184
185@hookimpl(trylast=True)

Callers 1

pytest_pyfunc_callFunction · 0.85

Calls 4

skipFunction · 0.90
warnMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected