-
-
Notifications
You must be signed in to change notification settings - Fork 1k
added cov-fail-under=100 for pytest #206
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
Conversation
httpx/models.py
Outdated
| self._uri_reference = self._uri_reference.copy_with( | ||
| authority=idna_authority | ||
| ) | ||
| ) # pragma: nocover |
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.
Instead of disabling coverage here let's create a simple unit test for the branch.
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.
I couldn't find a test case because if I try to Unicode domain, I get this error: rfc3986.exceptions.InvalidAuthority: The authority (😁.de) is not valid.
Should we change this part if there is no case or could you help me with this?
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.
What about ουτοπία.δπθ.gr? Emojis aren't valid for IDNs for IDNA 2008.
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.
idna encode raises an error if there is any char that greater then 128. (it's not just about emoji link) so this if clause is never used. If you want we can delete this part with another PR and check InvalidAuthority error?
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.
I think we can literally just get rid of that whole if statement branch. IRIReference.encode() does everything for us. Tested it locally and it seems to work for me.
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.
added a pr #210
httpx/utils.py
Outdated
|
|
||
| if netrc_path is None: | ||
| return None | ||
| return None # pragma: nocover |
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.
Can we also create a unit test for here?
|
Thanks @cansarigol! |
No description provided.