Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest_warning_captured deprecated in pytest 6 #55

Closed
okken opened this issue Oct 6, 2020 · 2 comments
Closed

pytest_warning_captured deprecated in pytest 6 #55

okken opened this issue Oct 6, 2020 · 2 comments

Comments

@okken
Copy link

okken commented Oct 6, 2020

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

@okken
Copy link
Author

okken commented Oct 6, 2020

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:

https://github.com/pytest-dev/pytest-xdist/blob/7bf654775dcd2fef9c0ebafbea982b7d180b740e/src/xdist/remote.py#L142-L164

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

@numirias
Copy link
Owner

Thanks for the instructive report! Patched in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants