Skip to content

Commit

Permalink
Merge pull request #2436 from colindickson/master
Browse files Browse the repository at this point in the history
Fix for failing test: test_connection_error
  • Loading branch information
Lukasa committed Feb 3, 2015
2 parents b137472 + ced6550 commit 69b7c45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,13 @@ def test_BASICAUTH_TUPLE_HTTP_200_OK_GET(self):
r = s.get(url)
assert r.status_code == 200

def test_connection_error(self):
def test_connection_error_invalid_domain(self):
"""Connecting to an unknown domain should raise a ConnectionError"""
with pytest.raises(ConnectionError):
requests.get("http://fooobarbangbazbing.httpbin.org")
requests.get("http://doesnotexist.google.com")

def test_connection_error_invalid_port(self):
"""Connecting to an invalid port should raise a ConnectionError"""
with pytest.raises(ConnectionError):
requests.get("http://httpbin.org:1")

Expand Down

0 comments on commit 69b7c45

Please sign in to comment.