MCPcopy
hub / github.com/urllib3/urllib3 / test_retry_total_none

Method test_retry_total_none

test/test_retry.py:64–79  ·  view source on GitHub ↗

if Total is none, connect error should take precedence

(self)

Source from the content-addressed store, hash-verified

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"""

Callers

nothing calls this directly

Calls 5

incrementMethod · 0.95
is_exhaustedMethod · 0.95
ConnectTimeoutErrorClass · 0.90
RetryClass · 0.90
ReadTimeoutErrorClass · 0.90

Tested by

no test coverage detected