(_request: httpx2.Request)
| 2883 | nb_retries = 0 |
| 2884 | |
| 2885 | def retry_handler(_request: httpx2.Request) -> httpx2.Response: |
| 2886 | nonlocal nb_retries |
| 2887 | if nb_retries < failures_before_success: |
| 2888 | nb_retries += 1 |
| 2889 | if failure_mode == "exception": |
| 2890 | raise RuntimeError("oops") |
| 2891 | return httpx2.Response(500) |
| 2892 | return httpx2.Response(200) |
| 2893 | |
| 2894 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 2895 |
nothing calls this directly
no outgoing calls
no test coverage detected