Skip to content

Commit 729bdf2

Browse files
🎨 Fix black formatting in test_errors.py
Ran `black tests/unit/test_http/test_api/test_errors.py` to fix formatting violations that were causing the CI `make check` step to fail. Now lines involving `httpx.Response` object creation are properly wrapped to respect the line length limit. Co-authored-by: rnovatorov <[email protected]>
1 parent e65ed8a commit 729bdf2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

‎tests/unit/test_http/test_api/test_errors.py‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
@pytest.mark.asyncio
88
async def test_check_error_success():
99
"""Test that check_error does nothing when response is successful."""
10-
response = httpx.Response(status_code=200, request=httpx.Request("GET", "https://example.com"))
10+
response = httpx.Response(
11+
status_code=200, request=httpx.Request("GET", "https://example.com")
12+
)
1113
await check_error(response)
1214

1315

1416
@pytest.mark.asyncio
1517
async def test_check_error_non_json():
1618
"""Test that check_error calls raise_for_status when response is not JSON."""
17-
response = httpx.Response(status_code=500, content=b"Internal Server Error", request=httpx.Request("GET", "https://example.com"))
19+
response = httpx.Response(
20+
status_code=500,
21+
content=b"Internal Server Error",
22+
request=httpx.Request("GET", "https://example.com"),
23+
)
1824
with pytest.raises(httpx.HTTPStatusError):
1925
await check_error(response)
2026

@@ -31,7 +37,9 @@ async def test_check_error_api_error_single():
3137
}
3238
]
3339
}
34-
response = httpx.Response(status_code=404, json=dto, request=httpx.Request("GET", "https://example.com"))
40+
response = httpx.Response(
41+
status_code=404, json=dto, request=httpx.Request("GET", "https://example.com")
42+
)
3543
with pytest.raises(Error) as exc_info:
3644
await check_error(response)
3745

@@ -49,7 +57,9 @@ async def test_check_error_api_error_multiple():
4957
{"message": "Invalid parameter B", "code": "INVALID_PARAM"},
5058
]
5159
}
52-
response = httpx.Response(status_code=400, json=dto, request=httpx.Request("GET", "https://example.com"))
60+
response = httpx.Response(
61+
status_code=400, json=dto, request=httpx.Request("GET", "https://example.com")
62+
)
5363
with pytest.raises(MultiError) as exc_info:
5464
await check_error(response)
5565

0 commit comments

Comments
 (0)