Closed okken closed 4 years ago
I asked the pytest mailing list for options on how to deal with this.
Got this from Bruno Oliveira: "...
An alternative is to check if the new hook exists, like how we used to do in pytest-xdist:
Where we implement one hook or the other, giving preference to the new hook when available. ... "
I think the xdist fix would work for pytest-json-report
Thanks for the instructive report! Patched in the latest release.
The plugin uses pytest_warning_captured, which was deprecated in pytest 6. https://docs.pytest.org/en/stable/reference.html#pytest.hookspec.pytest_warning_captured
Looks like there's a new hook, pytest_warning_recorded, with similar enough API: https://docs.pytest.org/en/stable/reference.html#pytest.hookspec.pytest_warning_recorded