(_request: httpx.Request)
| 1679 | nb_retries = 0 |
| 1680 | |
| 1681 | def retry_handler(_request: httpx.Request) -> httpx.Response: |
| 1682 | nonlocal nb_retries |
| 1683 | if nb_retries < failures_before_success: |
| 1684 | nb_retries += 1 |
| 1685 | if failure_mode == "exception": |
| 1686 | raise RuntimeError("oops") |
| 1687 | return httpx.Response(500) |
| 1688 | return httpx.Response(200) |
| 1689 | |
| 1690 | respx_mock.post("/v1/messages").mock(side_effect=retry_handler) |
| 1691 |
nothing calls this directly
no outgoing calls
no test coverage detected