MCPcopy
hub / github.com/urllib3/urllib3 / test_retry_other

Method test_retry_other

test/test_retry.py:103–115  ·  view source on GitHub ↗

If an unexpected error is raised, should retry other times

(self)

Source from the content-addressed store, hash-verified

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"""
105 other_error = SSLError()
106 retry = Retry(connect=1)
107 retry = retry.increment(error=other_error)
108 retry = retry.increment(error=other_error)
109 assert not retry.is_exhausted()
110
111 retry = Retry(other=1)
112 retry = retry.increment(error=other_error)
113 with pytest.raises(MaxRetryError) as e:
114 retry.increment(error=other_error)
115 assert e.value.reason == other_error
116
117 def test_retry_read_zero(self) -> None:
118 """No second chances on read timeouts, by default"""

Callers

nothing calls this directly

Calls 4

incrementMethod · 0.95
is_exhaustedMethod · 0.95
SSLErrorClass · 0.90
RetryClass · 0.90

Tested by

no test coverage detected