(pyfuncitem: Function)
| 159 | |
| 160 | @hookimpl(trylast=True) |
| 161 | def pytest_pyfunc_call(pyfuncitem: Function) -> object | None: |
| 162 | testfunction = pyfuncitem.obj |
| 163 | if is_async_function(testfunction): |
| 164 | async_fail(pyfuncitem.nodeid) |
| 165 | funcargs = pyfuncitem.funcargs |
| 166 | testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} |
| 167 | result = testfunction(**testargs) |
| 168 | if hasattr(result, class="st">"__await__") or hasattr(result, class="st">"__aiter__"): |
| 169 | async_fail(pyfuncitem.nodeid) |
| 170 | elif result is not None: |
| 171 | warnings.warn( |
| 172 | PytestReturnNotNoneWarning( |
| 173 | fclass="st">"Test functions should return None, but {pyfuncitem.nodeid} returned {type(result)!r}.\n" |
| 174 | class="st">"Did you mean to use `assert` instead of `return`?\n" |
| 175 | class="st">"See https://docs.pytest.org/en/stable/how-to/assert.htmlclass="cm">#return-not-none for more information." |
| 176 | ) |
| 177 | ) |
| 178 | return True |
| 179 | |
| 180 | |
| 181 | def pytest_collect_directory( |
nothing calls this directly
no test coverage detected