(_request: httpx2.Request)
| 1361 | nb_retries = 0 |
| 1362 | |
| 1363 | def retry_handler(_request: httpx2.Request) -> httpx2.Response: |
| 1364 | nonlocal nb_retries |
| 1365 | if nb_retries < failures_before_success: |
| 1366 | nb_retries += 1 |
| 1367 | if failure_mode == "exception": |
| 1368 | raise RuntimeError("oops") |
| 1369 | return httpx2.Response(500) |
| 1370 | return httpx2.Response(200) |
| 1371 | |
| 1372 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 1373 |
nothing calls this directly
no outgoing calls
no test coverage detected