Skip to content

Commit da3da4b

Browse files
fix: resolve ruff formatting issues
1 parent 5f8e675 commit da3da4b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

httpx/_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,9 @@ def build_request(
367367
if data is not None and isinstance(data, list):
368368
# Check if this looks like invalid JSON array (list of dicts/strings)
369369
# but allow valid multipart form data (list of 2-item tuples)
370-
if data and all(isinstance(item, (dict, str, int, float, bool)) for item in data):
370+
if data and all(
371+
isinstance(item, (dict, str, int, float, bool)) for item in data
372+
):
371373
raise TypeError(
372374
"Invalid value for 'data'. To send a JSON array, use the 'json' parameter. "
373375
"For form data, use a dictionary or a list of 2-item tuples."

tests/client/test_async_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,5 +411,7 @@ async def test_async_build_request_with_valid_data_formats():
411411
# This is a valid use case and should not raise our TypeError.
412412
# We explicitly catch and ignore the DeprecationWarning that httpx raises in this specific case.
413413
with pytest.warns(DeprecationWarning):
414-
request = client.build_request("POST", "https://example.com", data=[("a", "b")])
414+
request = client.build_request(
415+
"POST", "https://example.com", data=[("a", "b")]
416+
)
415417
assert isinstance(request, httpx.Request)

0 commit comments

Comments
 (0)