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. "
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):