-
-
Notifications
You must be signed in to change notification settings - Fork 359
Labels
Description
I made an HTTP adapter:
session = requests.Session()
session.verify = False
# Try max of 3 times before erroring out
retry_adapter = requests.adapters.HTTPAdapter(max_retries=3)
session.mount('https://', retry_adapter)
I wanted to make sure it will automatically retry, but it seems it's not getting triggered right:
exception = ConnectionError('Bad connection')
with responses.RequestsMock(assert_all_requests_are_fired=False) as rsp:
rsp.add(responses.POST, url, body=exception)
rsp.add(responses.POST, url, body=exception)
rsp.add(responses.POST, url, body='{}')
session.post(url=url, json={})
It just keeps raising the exception.
cjw296, k4nar, pwilczynskiclearcode, belthaZornv, dmartindelorme and 24 more