MCPcopy
hub / github.com/redis/redis-py / test_retry

Method test_retry

tests/test_retry.py:161–170  ·  view source on GitHub ↗
(self, retries)

Source from the content-addressed store, hash-verified

159
160 @pytest.mark.parametrize("retries", range(10))
161 def test_retry(self, retries):
162 backoff = BackoffMock()
163 retry = Retry(backoff, retries)
164 with pytest.raises(ConnectionError):
165 retry.call_with_retry(self._do, self._fail)
166
167 assert self.actual_attempts == 1 + retries
168 assert self.actual_failures == 1 + retries
169 assert backoff.reset_calls == 1
170 assert backoff.calls == retries
171
172 def test_infinite_retry(self):
173 backoff = BackoffMock()

Callers

nothing calls this directly

Calls 3

call_with_retryMethod · 0.95
RetryClass · 0.90
BackoffMockClass · 0.70

Tested by

no test coverage detected