taverntesting / tavern

A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax
https://taverntesting.github.io/
MIT License
1.02k stars 192 forks source link

Replace deprecated `pytest.warns(None)` #922

Closed mgorny closed 3 months ago

mgorny commented 4 months ago

Replace the deprecated pytest.warns(None) use with the error warning filter, as recommended in https://github.com/pytest-dev/pytest/issues/9404#issue-1076710891. With this change, the tests pass with pytest-8.1.1.

mgorny commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

I'm sorry, which one?

michaelboulton commented 3 months ago

I'm sorry, which one?

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

mgorny commented 3 months ago

I've updated the pull request now.

mgorny commented 3 months ago

Thanks!