Skip to content

Commit 96ea20c

Browse files
committed
restore original test_dont_crash_on_certificate_problems
1 parent 9d538e9 commit 96ea20c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/test_server.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import socket
55

66
import pytest
7-
import requests
7+
import requests.exceptions
88
from httpbin import app as httpbin_app
99
from util import get_raw_http_response
1010

@@ -42,7 +42,19 @@ def test_server_should_be_http_1_1(httpbin):
4242
assert resp.startswith(b"HTTP/1.1")
4343

4444

45-
def test_dont_crash_on_certificate_problems(httpbin_secure, capsys):
45+
def test_dont_crash_on_certificate_problems(httpbin_secure):
46+
with pytest.raises(requests.exceptions.SSLError):
47+
# this request used to hang
48+
requests.get(httpbin_secure + "/get", verify=True, cert=__file__)
49+
50+
# and this request would never happen
51+
requests.get(
52+
httpbin_secure + "/get",
53+
verify=True,
54+
)
55+
56+
57+
def test_dont_crash_on_handshake_timeout(httpbin_secure, capsys):
4658
with socket.socket() as sock:
4759
sock.connect((httpbin_secure.host, httpbin_secure.port))
4860
# this request used to hang

0 commit comments

Comments
 (0)