if Total is none, connect error should take precedence
(self)
| 62 | retry.increment(method="GET", error=error) |
| 63 | |
| 64 | def test_retry_total_none(self) -> None: |
| 65 | """if Total is none, connect error should take precedence""" |
| 66 | error = ConnectTimeoutError() |
| 67 | retry = Retry(connect=2, total=None) |
| 68 | retry = retry.increment(error=error) |
| 69 | retry = retry.increment(error=error) |
| 70 | with pytest.raises(MaxRetryError) as e: |
| 71 | retry.increment(error=error) |
| 72 | assert e.value.reason == error |
| 73 | |
| 74 | timeout_error = ReadTimeoutError(DUMMY_POOL, "/", "read timed out") |
| 75 | retry = Retry(connect=2, total=None) |
| 76 | retry = retry.increment(method="GET", error=timeout_error) |
| 77 | retry = retry.increment(method="GET", error=timeout_error) |
| 78 | retry = retry.increment(method="GET", error=timeout_error) |
| 79 | assert not retry.is_exhausted() |
| 80 | |
| 81 | def test_retry_default(self) -> None: |
| 82 | """If no value is specified, should retry connects 3 times""" |
nothing calls this directly
no test coverage detected