diff --git a/responses/test_responses.py b/responses/test_responses.py index a5c62bbf..7056c6be 100644 --- a/responses/test_responses.py +++ b/responses/test_responses.py @@ -3,6 +3,7 @@ import inspect import os import re +import warnings from io import BufferedReader from io import BytesIO from unittest.mock import Mock @@ -587,12 +588,10 @@ def run(): assert resp.status_code == status assert "foo" in resp.headers - with pytest.warns(None) as record: + with warnings.catch_warnings(): + warnings.simplefilter("error") run() - # check that no deprecation warning was raised - assert not record - assert_reset() diff --git a/setup.py b/setup.py index 9d66877a..a8818a54 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ ] tests_require = [ - "pytest>=4.6", + "pytest>=7.0.0", "coverage >= 6.0.0", "pytest-cov", "pytest-asyncio",