Skip to content

Commit b1695ec

Browse files
Apply black formatting to test_http_client_retry.py
1 parent 2bb414f commit b1695ec

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed

tests/test_http_client_retry.py

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ def test_retries_on_408_error(self, sync_http_client, retry_config, monkeypatch)
111111
)
112112

113113
self.assert_request_with_retries(
114-
sync_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
114+
sync_http_client,
115+
call_count,
116+
expected_call_count=4,
117+
expected_sleep_count=3,
118+
retry_config=retry_config,
115119
)
116120

117121
def test_retries_on_500_error(self, sync_http_client, retry_config, monkeypatch):
@@ -126,7 +130,11 @@ def test_retries_on_500_error(self, sync_http_client, retry_config, monkeypatch)
126130
)
127131

128132
self.assert_request_with_retries(
129-
sync_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
133+
sync_http_client,
134+
call_count,
135+
expected_call_count=4,
136+
expected_sleep_count=3,
137+
retry_config=retry_config,
130138
)
131139

132140
def test_retries_on_502_error(self, sync_http_client, retry_config, monkeypatch):
@@ -141,7 +149,11 @@ def test_retries_on_502_error(self, sync_http_client, retry_config, monkeypatch)
141149
)
142150

143151
self.assert_request_with_retries(
144-
sync_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
152+
sync_http_client,
153+
call_count,
154+
expected_call_count=4,
155+
expected_sleep_count=3,
156+
retry_config=retry_config,
145157
)
146158

147159
def test_retries_on_504_error(self, sync_http_client, retry_config, monkeypatch):
@@ -156,10 +168,16 @@ def test_retries_on_504_error(self, sync_http_client, retry_config, monkeypatch)
156168
)
157169

158170
self.assert_request_with_retries(
159-
sync_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
171+
sync_http_client,
172+
call_count,
173+
expected_call_count=4,
174+
expected_sleep_count=3,
175+
retry_config=retry_config,
160176
)
161177

162-
def test_no_retry_on_non_retryable_error(self, sync_http_client, retry_config, monkeypatch):
178+
def test_no_retry_on_non_retryable_error(
179+
self, sync_http_client, retry_config, monkeypatch
180+
):
163181
"""Test that a non retryable error errors do NOT trigger retry (not in RETRY_STATUS_CODES)."""
164182
mock_request, call_count = self.create_mock_request_with_retries(
165183
failure_count=100, # Always fail
@@ -334,7 +352,9 @@ async def assert_async_request_with_retries(
334352

335353
with patch("asyncio.sleep") as mock_sleep:
336354
if retry_config:
337-
response = await http_client.request("test/path", retry_config=retry_config)
355+
response = await http_client.request(
356+
"test/path", retry_config=retry_config
357+
)
338358
else:
339359
response = await http_client.request("test/path")
340360

@@ -357,7 +377,11 @@ async def test_retries_on_408_error(
357377
)
358378

359379
await self.assert_async_request_with_retries(
360-
async_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
380+
async_http_client,
381+
call_count,
382+
expected_call_count=4,
383+
expected_sleep_count=3,
384+
retry_config=retry_config,
361385
)
362386

363387
@pytest.mark.asyncio
@@ -375,7 +399,11 @@ async def test_retries_on_500_error(
375399
)
376400

377401
await self.assert_async_request_with_retries(
378-
async_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
402+
async_http_client,
403+
call_count,
404+
expected_call_count=4,
405+
expected_sleep_count=3,
406+
retry_config=retry_config,
379407
)
380408

381409
@pytest.mark.asyncio
@@ -393,7 +421,11 @@ async def test_retries_on_502_error(
393421
)
394422

395423
await self.assert_async_request_with_retries(
396-
async_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
424+
async_http_client,
425+
call_count,
426+
expected_call_count=4,
427+
expected_sleep_count=3,
428+
retry_config=retry_config,
397429
)
398430

399431
@pytest.mark.asyncio
@@ -411,7 +443,11 @@ async def test_retries_on_504_error(
411443
)
412444

413445
await self.assert_async_request_with_retries(
414-
async_http_client, call_count, expected_call_count=4, expected_sleep_count=3, retry_config=retry_config
446+
async_http_client,
447+
call_count,
448+
expected_call_count=4,
449+
expected_sleep_count=3,
450+
retry_config=retry_config,
415451
)
416452

417453
@pytest.mark.asyncio

0 commit comments

Comments
 (0)