()
| 59 | class TestWithRetry(unittest.TestCase): |
| 60 | def test_success_on_first_try(self) -> None: |
| 61 | async def _run() -> None: |
| 62 | call_count = 0 |
| 63 | |
| 64 | async def operation(attempt: int, ctx: RetryContext) -> str: |
| 65 | nonlocal call_count |
| 66 | call_count += 1 |
| 67 | return "ok" |
| 68 | |
| 69 | result = await with_retry(operation, RetryOptions(max_retries=3)) |
| 70 | self.assertEqual(result, "ok") |
| 71 | self.assertEqual(call_count, 1) |
| 72 | |
| 73 | asyncio.run(_run()) |
| 74 |
nothing calls this directly
no test coverage detected