Closed alexdrydew closed 1 year ago
Looking at the stack trace, it's seems to be a httpx
"bug". I don't think we should try to fix this in respx, but rather open an httpx issue and hopefully it gets fixed there, and then automatically gets supported in respx.
I believe this is a misuse of the httpx.URL
:
https://github.com/lundberg/respx/blob/b014780bde8e82a65fc6bb02d62b89747189565c/respx/patterns.py#L417
RESPX attempts to initialize it with the unquoted path (which is indeed an invalid URL in this case), while httpx.URL
seems to work correctly with the quoted version of the URL.
Well, that might be the case. Let's handle the URL
instantiation same way as httpx does then, if they support the unparsed url š
Hey!
I have faced a bug during an attempt to use respx with hypothesis to mock autogenerated URLs when encoded special symbols are present in the url path.
This code fails with the
AllMockedAssertionError
:This code fails with
httpx.InvalidURL
:Full traceback:
I could reproduce this problem only with the
url
pattern, the following works fine:Versions: