diff --git a/test_requests.py b/test_requests.py index 716c0dcf..3868f9dc 100755 --- a/test_requests.py +++ b/test_requests.py @@ -286,6 +286,11 @@ class RequestsTestCase(unittest.TestCase): r = s.get(url) assert r.status_code == 200 + def test_connection_error(self): + """Connecting to an unknown domain should raise a ConnectionError""" + with pytest.raises(ConnectionError): + requests.get("http://fooobarbangbazbing.httpbin.org") + def test_basicauth_with_netrc(self): auth = ('user', 'pass') wrong_auth = ('wronguser', 'wrongpass')