Summary
from collections.abc import Generator
from pytest import TestReport, hookimpl
@hookimpl(wrapper=True)
def pytest_runtest_makereport() -> Generator[None, TestReport, TestReport]:
result = yield
result.outcome = "passed"
return result # error: return-in-generator (B901)
this is the intended usage of pytest hook wrappers. see https://docs.pytest.org/en/stable/how-to/writing_hook_functions.html#hook-wrappers-executing-around-other-hooks
this behavior was introduced in 0.14.8 (#21200)
Version
0.14.8