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

Method test_retry

tests/test_asyncio/test_retry.py:98–107  ·  view source on GitHub ↗
(self, retries: int)

Source from the content-addressed store, hash-verified

96 @pytest.mark.parametrize("retries", range(10))
97 @pytest.mark.asyncio
98 async def test_retry(self, retries: int):
99 backoff = BackoffMock()
100 retry = Retry(backoff, retries)
101 with pytest.raises(ConnectionError):
102 await retry.call_with_retry(self._do, self._fail)
103
104 assert self.actual_attempts == 1 + retries
105 assert self.actual_failures == 1 + retries
106 assert backoff.reset_calls == 1
107 assert backoff.calls == retries
108
109 @pytest.mark.asyncio
110 async def test_infinite_retry(self):

Callers

nothing calls this directly

Calls 3

call_with_retryMethod · 0.95
RetryClass · 0.90
BackoffMockClass · 0.70

Tested by

no test coverage detected