Skip to content

Commit

Permalink
[1.26] Fix invalid test_ssl_failure_midway_through_conn
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Apr 30, 2023
1 parent 25cca38 commit d25cf83
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/with_dummyserver/test_socketlevel.py
Expand Up @@ -1221,10 +1221,11 @@ def socket_handler(listener):
ssl_sock.close()

self._start_server(socket_handler)
with HTTPSConnectionPool(self.host, self.port) as pool:
with pytest.raises(MaxRetryError) as cm:
pool.request("GET", "/", retries=0)
assert isinstance(cm.value.reason, SSLError)
with HTTPSConnectionPool(self.host, self.port, ca_certs=DEFAULT_CA) as pool:
with pytest.raises(
SSLError, match=r"(wrong version number|record overflow)"
):
pool.request("GET", "/", retries=False)

@notSecureTransport
def test_ssl_read_timeout(self):
Expand Down

0 comments on commit d25cf83

Please sign in to comment.