style: format code

This commit is contained in:
Бакыт Ниязалиев 2025-06-11 22:46:51 +07:00
parent f1af56bc1e
commit 1900356454
4 changed files with 8 additions and 13 deletions

View File

@ -331,9 +331,7 @@ class StreamClosed(StreamError):
"""
def __init__(self) -> None:
message = (
"Attempted to read or stream content, but the stream has " "been closed."
)
message = "Attempted to read or stream content, but the stream has been closed."
super().__init__(message)

View File

@ -9,12 +9,9 @@ class ParseResult:
@property
def authority(self) -> str: ...
@property
def netloc(self) -> str: ...
def __str__(self) -> str: ...
def __new__(
cls,
scheme: str,

View File

@ -379,7 +379,7 @@ class URL:
if ":" in userinfo:
# Mask any password component.
userinfo = f'{userinfo.split(":")[0]}:[secure]'
userinfo = f"{userinfo.split(':')[0]}:[secure]"
authority = "".join(
[

View File

@ -489,18 +489,18 @@ def test_response_invalid_argument():
def test_ensure_ascii_false_with_french_characters():
data = {"greeting": "Bonjour, ça va ?"}
response = httpx.Response(200, json=data)
assert (
"ça va" in response.text
), "ensure_ascii=False should preserve French accented characters"
assert "ça va" in response.text, (
"ensure_ascii=False should preserve French accented characters"
)
assert response.headers["Content-Type"] == "application/json"
def test_separators_for_compact_json():
data = {"clé": "valeur", "liste": [1, 2, 3]}
response = httpx.Response(200, json=data)
assert (
response.text == '{"clé":"valeur","liste":[1,2,3]}'
), "separators=(',', ':') should produce a compact representation"
assert response.text == '{"clé":"valeur","liste":[1,2,3]}', (
"separators=(',', ':') should produce a compact representation"
)
assert response.headers["Content-Type"] == "application/json"