diff options
author | Thomas Grainger <tagrain@gmail.com> | 2023-04-24 19:12:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 13:12:46 -0500 |
commit | 4c4451b51ddb6e482a81a2607bdcdfe58da8651c (patch) | |
tree | d0fbac26d5257704f0d5c83c24be2d795695ffaa /test/with_dummyserver/test_https.py | |
parent | 214b184923388328919b0a4b0c15bff603aa51be (diff) | |
download | urllib3-4c4451b51ddb6e482a81a2607bdcdfe58da8651c.tar.gz |
Fix InsecureRequestWarning warnings in test suite
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
Diffstat (limited to 'test/with_dummyserver/test_https.py')
-rw-r--r-- | test/with_dummyserver/test_https.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py index 2a710bfd..de71c5a6 100644 --- a/test/with_dummyserver/test_https.py +++ b/test/with_dummyserver/test_https.py @@ -608,7 +608,8 @@ class TestHTTPS(HTTPSDummyServerTestCase): cert_reqs="CERT_NONE", ssl_minimum_version=self.tls_version(), ) as https_pool: - https_pool.request("GET", "/") + with pytest.warns(InsecureRequestWarning): + https_pool.request("GET", "/") def test_tunnel(self) -> None: """test the _tunnel behavior""" @@ -626,7 +627,8 @@ class TestHTTPS(HTTPSDummyServerTestCase): with mock.patch.object( conn, "_tunnel", create=True, return_value=None ) as conn_tunnel: - https_pool._make_request(conn, "GET", "/") + with pytest.warns(InsecureRequestWarning): + https_pool._make_request(conn, "GET", "/") conn_tunnel.assert_called_once_with() finally: conn.close() |