You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RequestsMock doesn't catch requests that are sent inside the default asyncio executor. As a result, real HTTP requests are sent.
Additional context
Python 3.9 - 3.11
Version of responses
0.24.1
Steps to Reproduce
importasyncioimportresponsesimportrequestsdefsend_request():
# Here a real HTTP request will be sentresponse=requests.get('https://example.com/')
print(response.content)
defmain():
withresponses.RequestsMock(assert_all_requests_are_fired=False) asrsps:
rsps.get('https://example.com/', body='test')
loop=asyncio.get_event_loop()
loop.run_in_executor(None, send_request)
# but send_request() works correct and DOES NOT send a real HTTP requestmain()
Expected Result
test should be printed.
Actual Result
A real HTTP request is sent to https://example.com/, and a page body b'<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>.... is printed.
The text was updated successfully, but these errors were encountered:
Describe the bug
RequestsMock
doesn't catch requests that are sent inside the default asyncio executor. As a result, real HTTP requests are sent.Additional context
Python 3.9 - 3.11
Version of
responses
0.24.1
Steps to Reproduce
Expected Result
test
should be printed.Actual Result
A real HTTP request is sent to https://example.com/, and a page body
b'<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>....
is printed.The text was updated successfully, but these errors were encountered: