Skip to content
Myr

split test_connection_error into two distinct tests, and changed "unknown url" test URL since fooobarbangbazbing.httpbin.org currently gives a valid response.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Colin Dickson · committed by Colin Dickson · parent b137472 · Browse files · 1 file+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:test_requests.py+4 added-2 removed
299 unmodified lines
300 s.auth = auth301 r = s.get(url)302 assert r.status_code == 200303304 def test_connection_error(self):304 def test_connection_error_invalid_domain(self):305 """Connecting to an unknown domain should raise a ConnectionError"""306 with pytest.raises(ConnectionError):307 requests.get("http://fooobarbangbazbing.httpbin.org")307 requests.get("http://doesnotexist.google.com")308309 def test_connection_error_invalid_port(self):310 """Connecting to an invalid port should raise a ConnectionError"""311 with pytest.raises(ConnectionError):312 requests.get("http://httpbin.org:1")313314 def test_LocationParseError(self):
1288 unmodified lines