From cc23d1c6445d61c1e6905cae4861d6e3c3244274 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Thu, 11 Apr 2024 21:10:36 +0200 Subject: [PATCH] Fix compatibility with pytest 8 `pytest.warns(None)` has been deprecated in pytest 7.0.0 and it's no longer working in pytest 8. Resolves: https://github.com/psf/requests/issues/6679 --- requirements-dev.txt | 2 +- tests/test_requests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 13173f3ae5..e80b18581e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -e .[socks] -pytest>=2.8.0,<=6.2.5 +pytest>=2.8.0,<9 pytest-cov pytest-httpbin==2.0.0 httpbin~=0.10.0 diff --git a/tests/test_requests.py b/tests/test_requests.py index 4de47bc693..d05febeef5 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -1003,7 +1003,7 @@ def test_https_warnings(self, nosan_server): "SubjectAltNameWarning", ) - with pytest.warns(None) as warning_records: + with pytest.warns() as warning_records: warnings.simplefilter("always") requests.get(f"https://localhost:{port}/", verify=ca_bundle)