-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
responses multipart_matcher does not consume the passed iterator; how to mock? #713
Labels
Comments
kfot
changed the title
mocked response with unconsumed iterator as a param makes the code hang
mocked response with unconsumed iterator makes the code hang
May 13, 2024
kfot
changed the title
mocked response with unconsumed iterator makes the code hang
mocking a response consuming an iterator makes the code hang
May 13, 2024
can you please provide a minimal reproducible ? |
Feeding multipart requests that way is fine but hangs the responses (as the iterators are not consumed and
Avoiding the |
getsantry
bot
added
Waiting for: Product Owner
and removed
Waiting for: Community
labels
May 17, 2024
getsantry
bot
moved this from Waiting for: Community
to Waiting for: Product Owner
in GitHub Issues with 👀 3
May 17, 2024
kfot
changed the title
mocking a response consuming an iterator makes the code hang
responses multipart_matcher does not consume the passed iterator; how to mock?
Jun 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hi, I am developing some python code utilizing mulipart/form-data headers for uploading a file. When I try to mock the endpoint response with the following code, then it hangs.
Responses: 0.25.0
Python: 3.11
Additional context
Once I will add a multipart matcher, I can get an error stating that the iterator does not match the data (as the generator is just an object in the memory).
Version of
responses
0.25.0
Steps to Reproduce
Add an generator to be consumed by the request.
Expected Result
Code using responses does not hang anymore.
Actual Result
Tests using responses hang.
The text was updated successfully, but these errors were encountered: