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

Updated checks that no warnings were raised #6076

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

radarhere
Copy link
Member

A warning has started appearing.

https://github.com/python-pillow/Pillow/runs/5266944375#step:8:3064

PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

It is complaining about our method for checking that no warnings were raised during a test.

with pytest.warns(None) as record:
    ...
assert not record

Instead, https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests suggests

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

I have implemented that here, albeit without the simplefilter, since I presume we would also like to know if any errors are raised.

@radarhere radarhere changed the title Updated checks for no warnings Updated checks that no warnings were raised Feb 21, 2022
@hugovk hugovk merged commit 9e6537d into python-pillow:main Feb 21, 2022
@radarhere radarhere deleted the pytest branch February 21, 2022 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants