Open andrew-cybsafe opened 4 months ago
@markstory can you kick off the tests again?
@markstory I think we decided to deprecate this completely a while ago
https://github.com/getsentry/responses?tab=readme-ov-file#deprecations-and-migration-path
I think we decided to deprecate this completely a while ago
@beliaev-maksim the linked doc deprecates responses.assert_all_requests_are_fired
for responses.mock.assert_all_requests_are_fired
. It's the latter / non-deprecated option that isn't working correctly.
it feels like the logic should be moved down to the
activate()
method. Have you exhausted all the options to make the change self contained withinactivate
?
@beliaev-maksim
The attribute assert_all_requests_are_fired
is mocked within the get_wrapped() function regardless of whether a value has been passed into the function. This seems to make it difficult to fix this issue outside of get_wrapped(). I did try only mocking the attribute if the value was passed in, e.g. with this code:
if assert_all_requests_are_fired is not None:
assert_mock = std_mock.patch.object(
target=responses,
attribute="assert_all_requests_are_fired",
new=assert_all_requests_are_fired,
)
else:
from contextlib import nullcontext
assert_mock = nullcontext()
This mostly works except for the test_nested_decorators test, but given I only have a superficial understanding of this code, delving into that is more than I can take on right now.
A somewhat naive fix for the global assert_all_requests_are_fired. Tests are passing locally on 3.12.