PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.49k stars 580 forks source link

Drop deprecated pytest.warns(None) #2235

Open stanislavlevin opened 8 months ago

stanislavlevin commented 8 months ago

With Pytest 7:

https://docs.pytest.org/en/stable/changelog.html#pytest-7-0-0rc1-2021-12-06

8645: pytest.warns(None) is now deprecated because many people used

it to mean “this code does not emit warnings”, but it actually had the effect of checking that the code emits at least one warning of any type-like pytest.warns() or pytest.warns(Warning)

With Pytest 8 it's the error.

Changed according to the documentation: https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests

Fixes: https://github.com/PyCQA/isort/issues/2234