New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map UnsupportedProtocol to InvalidURL #1904
Map UnsupportedProtocol to InvalidURL #1904
Conversation
httpx.get("https://example<>.com") | ||
|
||
with pytest.raises(httpx.InvalidURL): | ||
httpx.get("https://🦋") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure if this is the best place for tests.
…aminalaee/httpx into map-unsupported-protocol-to-invalid-url
@@ -66,8 +64,3 @@ def test_stream(server): | |||
assert response.reason_phrase == "OK" | |||
assert response.text == "Hello, world!" | |||
assert response.http_version == "HTTP/1.1" | |||
|
|||
|
|||
def test_get_invalid_url(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate.
I think... we probably need to dig into expected behaviours a little more here, before pushing on with changes. I'm going to discuss this against this issue itself... |
@tomchristie Agreed. This will basically omit UnsupportedProtocol. |
Refs #1832 .
Updates mapping to raise InvalidURL for UnsupportedProtocol exceptions from httpcore.
Not sure if this is the best approach.
Any feedback is appreciated.