If no value is specified, should retry connects 3 times
(self)
| 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""" |
| 83 | retry = Retry() |
| 84 | assert retry.total == 10 |
| 85 | assert retry.connect is None |
| 86 | assert retry.read is None |
| 87 | assert retry.redirect is None |
| 88 | assert retry.other is None |
| 89 | |
| 90 | error = ConnectTimeoutError() |
| 91 | retry = Retry(connect=1) |
| 92 | retry = retry.increment(error=error) |
| 93 | with pytest.raises(MaxRetryError): |
| 94 | retry.increment(error=error) |
| 95 | |
| 96 | retry = Retry(connect=1) |
| 97 | retry = retry.increment(error=error) |
| 98 | assert not retry.is_exhausted() |
| 99 | |
| 100 | assert Retry(0).raise_on_redirect |
| 101 | assert not Retry(False).raise_on_redirect |
| 102 | |
| 103 | def test_retry_other(self) -> None: |
| 104 | """If an unexpected error is raised, should retry other times""" |
nothing calls this directly
no test coverage detected