Skip to content

Commit 364697e

Browse files
authored
Upgrade Python formatter ruff (#3651)
1 parent 8910202 commit 364697e

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

httpx/_exceptions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@ class StreamClosed(StreamError):
331331
"""
332332

333333
def __init__(self) -> None:
334-
message = (
335-
"Attempted to read or stream content, but the stream has " "been closed."
336-
)
334+
message = "Attempted to read or stream content, but the stream has been closed."
337335
super().__init__(message)
338336

339337

httpx/_urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def __repr__(self) -> str:
379379

380380
if ":" in userinfo:
381381
# Mask any password component.
382-
userinfo = f'{userinfo.split(":")[0]}:[secure]'
382+
userinfo = f"{userinfo.split(':')[0]}:[secure]"
383383

384384
authority = "".join(
385385
[

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ coverage[toml]==7.6.1
2222
cryptography==44.0.1
2323
mypy==1.13.0
2424
pytest==8.3.4
25-
ruff==0.8.1
25+
ruff==0.12.11
2626
trio==0.27.0
2727
trio-typing==0.10.0
2828
trustme==1.2.0

tests/test_content.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,18 +489,18 @@ def test_response_invalid_argument():
489489
def test_ensure_ascii_false_with_french_characters():
490490
data = {"greeting": "Bonjour, ça va ?"}
491491
response = httpx.Response(200, json=data)
492-
assert (
493-
"ça va" in response.text
494-
), "ensure_ascii=False should preserve French accented characters"
492+
assert "ça va" in response.text, (
493+
"ensure_ascii=False should preserve French accented characters"
494+
)
495495
assert response.headers["Content-Type"] == "application/json"
496496

497497

498498
def test_separators_for_compact_json():
499499
data = {"clé": "valeur", "liste": [1, 2, 3]}
500500
response = httpx.Response(200, json=data)
501-
assert (
502-
response.text == '{"clé":"valeur","liste":[1,2,3]}'
503-
), "separators=(',', ':') should produce a compact representation"
501+
assert response.text == '{"clé":"valeur","liste":[1,2,3]}', (
502+
"separators=(',', ':') should produce a compact representation"
503+
)
504504
assert response.headers["Content-Type"] == "application/json"
505505

506506

0 commit comments

Comments
 (0)