8000 [1.26] Fix invalid test_ssl_failure_midway_through_conn · urllib3/urllib3@d25cf83 · GitHub
[go: up one dir, main page]

Skip to content

Commit d25cf83

Browse files
authored
[1.26] Fix invalid test_ssl_failure_midway_through_conn
1 parent 25cca38 commit d25cf83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/with_dummyserver/test_socketlevel.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,10 +1221,11 @@ def socket_handler(listener):
12211221
ssl_sock.close()
12221222

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

12291230
@notSecureTransport
12301231
def test_ssl_read_timeout(self):

0 commit comments

Comments
 (0)
0