Changed ConnectionError to InvalidURL

This commit is contained in:
ContinuousFunction
2014-11-16 16:39:08 -08:00
parent 087a27aba9
commit 3246b1fe17
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -354,7 +354,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
try:
scheme, auth, host, port, path, query, fragment = parse_url(url)
except LocationParseError as e:
raise ConnectionError(e.message)
raise InvalidURL(e.message)
if not scheme:
raise MissingSchema("Invalid URL {0!r}: No schema supplied. "
+2 -2
View File
@@ -310,8 +310,8 @@ class RequestsTestCase(unittest.TestCase):
requests.get("http://httpbin.org:1")
def test_LocationParseError(self):
"""Inputing a URL that cannot be parsed should raise a ConnectionError"""
with pytest.raises(ConnectionError):
"""Inputing a URL that cannot be parsed should raise an InvalidURL error"""
with pytest.raises(InvalidURL):
requests.get("http://fe80::5054:ff:fe5a:fc0")
def test_basicauth_with_netrc(self):