We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a http call is being retried, only 1 call count is registered:
import requests_mock from requests.adapters import HTTPAdapter, Retry from requests import Session def call_url(): retry = Retry(total=3, backoff_factor=1, status_forcelist=[429, 500, 502, 503, 504], allowed_methods=['GET']) adapter = HTTPAdapter(max_retries=retry) http = Session() http.mount("http://", adapter) http.get(f"http://localhost") responses = [ {'status_code': 429}, {'status_code': 504}, {'status_code': 200}, ] with requests_mock.Mocker() as m: m.get('http://localhost', responses) call_url() assert m.call_count == 3
There should be 3 calls, but only 1 call happens.
3
1
Sounds like the http status code isn't propagated properly
The text was updated successfully, but these errors were encountered:
This one i can't fix unfortunately. Requests_mock mocks out the Adapter as well so it's responding with the result before ever entering the retry.
Sorry, something went wrong.
No branches or pull requests
When a http call is being retried, only 1 call count is registered:
There should be
3
calls, but only1
call happens.Sounds like the http status code isn't propagated properly
The text was updated successfully, but these errors were encountered: