Skip to content

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.

2 participants