File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 44import socket
55
66import pytest
7- import requests
7+ import requests . exceptions
88from httpbin import app as httpbin_app
99from 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
You can’t perform that action at this time.
0 commit comments