MCPcopy
hub / github.com/urllib3/urllib3 / test_retry_default

Method test_retry_default

test/test_retry.py:81–101  ·  view source on GitHub ↗

If no value is specified, should retry connects 3 times

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected