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 warnings fix #1192

Merged
merged 2 commits into from Feb 12, 2022
Merged

Pytest warnings fix #1192

merged 2 commits into from Feb 12, 2022

Conversation

kulikjak
Copy link
Contributor

Summary of changes

Pytest recently deprecated passing None as pytest.warns argument. As per the documentation [1], new preferred way of ensuring that no warnings are emitted is:

with warnings.catch_warnings():
    warnings.simplefilter("error")

I verified that this change doesn't work only with the latest Pytest (7.0.0 at this time) but also with much older 4.4.0.

[1] https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests

Pull Request Checklist

  • Changes have tests (changes are tests!)
  • Authors have been added to AUTHORS.md
  • News fragment added in changelog.d. See CONTRIBUTING.md for details - I presume it's not necessary in this case?

@pganssle
Copy link
Member

Great, thanks!

@pganssle pganssle merged commit 1eea4fc into dateutil:master Feb 12, 2022
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.

None yet

2 participants