(_request: httpx2.Request)
| 1415 | nb_retries = 0 |
| 1416 | |
| 1417 | def retry_handler(_request: httpx2.Request) -> httpx2.Response: |
| 1418 | nonlocal nb_retries |
| 1419 | if nb_retries < failures_before_success: |
| 1420 | nb_retries += 1 |
| 1421 | if failure_mode == "exception": |
| 1422 | raise RuntimeError("oops") |
| 1423 | return httpx2.Response(500) |
| 1424 | return httpx2.Response(200) |
| 1425 | |
| 1426 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 1427 |
nothing calls this directly
no outgoing calls
no test coverage detected