-
Notifications
You must be signed in to change notification settings - Fork 43
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
Overcounting pass-through requests #126
Comments
Yes, unfortunately this is true. Simply put, this is due to both the ConnectionPool and the Connection In pass through mode, both gets hit and recorded, but without pass through the mocked response will be returned directly by i.e. the connection pool and recorded correctly. This is noticed and marked as a TODO in this test. I don't think the solution is to exclude the connection transport from patching. Any thoughts and ideas welcome 😉 One think you could try though, is to tell respx to patch with respx.mock(using="httpx") as mock:
... |
Thanks! I confirmed the new feature works for me. Do you think it would be a good idea to add a flag to the request object going through Anyhow, the workaround works for me and I'll let you decide if you want to keep this issue open. |
Great! I see three alternatives solving the over-counting issue related to using the
Anyhow, great that it could be solved for you. I'll leave the issue open and under consideration a little longer. Thanks. |
It appears that pass-through calls are seeing 2x the actual call count. Is this behavior expected?
Environment:
The text was updated successfully, but these errors were encountered: