-
Notifications
You must be signed in to change notification settings - Fork 39
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
respx_mock
doesn't handle //
in the path-section of URLs.
#273
Comments
respx_mock
does not seem to handle //
in the path-section of URLs.respx_mock
doesn't //
in the path-section of URLs.
respx_mock
doesn't //
in the path-section of URLs.respx_mock
doesn't handle //
in the path-section of URLs.
I noticed the issue as I am using hypothesis to run property-based tests on my code, in particular using their provisional.urls strategy. The above parametrized tests can instead be run under import httpx
from hypothesis import HealthCheck
from hypothesis import given
from hypothesis import settings
from hypothesis.provisional import urls
from hypothesis.strategies import register_type_strategy
from pydantic import AnyHttpUrl
from respx import MockRouter
register_type_strategy(AnyHttpUrl, urls())
@given(...)
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
async def test_respx_targeting(respx_mock: MockRouter, url: AnyHttpUrl) -> None:
# Reset the function scoped fixture as it is used with hypothesis
respx_mock.reset()
route = respx_mock.get(url=url).respond(status_code=200)
result = httpx.get(url)
assert result.status_code == 200
assert route.called To ensure that the property holds for "all" |
Looked a bit more, and regarding Regarding |
Hi,
I just stumbled upon the issue described in the title, which can be reproduced with the following
pytest
file.The fails all take the form of:
Having
//
in the path sections of URLs is valid according to RFC 3986 (see section '3: Syntax Components' and section '3.3. Path'), Stack Overflow seems to concur.The text was updated successfully, but these errors were encountered: