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

Replace deprecated pytest.warns(None) #922

Merged
merged 2 commits into from
May 11, 2024

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Mar 28, 2024

Replace the deprecated pytest.warns(None) use with the error warning filter, as recommended
in pytest-dev/pytest#9404 (comment). With this change, the tests pass with pytest-8.1.1.

@mgorny
Copy link
Contributor Author

mgorny commented Mar 29, 2024

Alternatively, I can change it to use warnings.catch_warnings(record=True) or the recwarn fixture, and continue to check for zero recorded warnings.

@michaelboulton
Copy link
Member

Alternatively, I can change it to use warnings.catch_warnings(record=True) or the recwarn fixture, and continue to check for zero recorded warnings.

I think it's best to do this

@mgorny
Copy link
Contributor Author

mgorny commented Apr 13, 2024

I'm sorry, which one?

@michaelboulton
Copy link
Member

I'm sorry, which one?

Probably the first one, seems like that makes the most sense.

Replace the deprecated `pytest.warns(None)` with the standard library
`warnings.catch_warnings(record=True)`, in order to fix compatibility
with pytest-8.1.2.
@mgorny
Copy link
Contributor Author

mgorny commented Apr 27, 2024

I've updated the pull request now.

@michaelboulton michaelboulton merged commit 89f2a84 into taverntesting:master May 11, 2024
7 checks passed
@mgorny mgorny deleted the pytest-warns-none branch May 11, 2024 16:03
@mgorny
Copy link
Contributor Author

mgorny commented May 11, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants