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

Function pytest_pyfunc_call

src/_pytest/python.py:186–195  ·  view source on GitHub ↗
(pyfuncitem: "Function")

Source from the content-addressed store, hash-verified

184
185@hookimpl(trylast=True)
186def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]:
187 testfunction = pyfuncitem.obj
188 if is_async_function(testfunction):
189 async_warn_and_skip(pyfuncitem.nodeid)
190 funcargs = pyfuncitem.funcargs
191 testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames}
192 result = testfunction(**testargs)
193 if hasattr(result, "__await__") or hasattr(result, "__aiter__"):
194 async_warn_and_skip(pyfuncitem.nodeid)
195 return True
196
197
198def pytest_collect_file(file_path: Path, parent: nodes.Collector) -> Optional["Module"]:

Callers

nothing calls this directly

Calls 2

is_async_functionFunction · 0.90
async_warn_and_skipFunction · 0.85

Tested by

no test coverage detected