-
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
Confusion around assert_all_mocked behavior #204
Comments
Furthermore, it appears passing in anything to the respx.mock decorator changes behavior: e.g. @respx.mock(base_url="http://example.com")
async def test_with_base_url():
async with httpx.AsyncClient() as client:
respx.get("/user").mock(return_value=httpx.Response(200, content="test"))
resp = await client.get("http://example.com/user")
assert resp.content == b"test"
@respx.mock
async def test_without_base_url():
async with httpx.AsyncClient() as client:
respx.get("http://example.com/user").mock(
return_value=httpx.Response(200, content="test")
)
resp = await client.get("http://example.com/user")
assert resp.content == b"test" Results in:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given these 3 identical tests with different assert_all_mocked inputs, here is the output:
Shouldn't all of these tests pass if the tests are identical and rely on the mock?
Also, I see that the default assert_all_mocked value is True. Why is it that the behavior of not passing in a value is different from passing in True?
The text was updated successfully, but these errors were encountered: