Skip to content
Myr

Upgrade Python formatter ruff (#3651)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Clauss · committed by GitHub · parent 8910202 · Browse files · 4 files+9 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+9 added−11 removed

  • tests:+6 added−6 removed
  • other:+3 added−5 removed

4 files+9 added−11 removed

modified:httpx/_exceptions.py+1 added-3 removed
329 unmodified lines
330 closed.331 """332333 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."335 super().__init__(message)336337338class ResponseNotRead(StreamError):
39 unmodified lines
modified:httpx/_urls.py+1 added-1 removed
377 unmodified lines
378 scheme, userinfo, host, port, path, query, fragment = self._uri_reference379380 if ":" in userinfo:381 # Mask any password component.382 userinfo = f'{userinfo.split(":")[0]}:[secure]'382 userinfo = f"{userinfo.split(':')[0]}:[secure]"383384 authority = "".join(385 [386 f"{userinfo}@" if userinfo else "",
255 unmodified lines
modified:tests/test_content.py+6 added-6 removed
487 unmodified lines
488489def test_ensure_ascii_false_with_french_characters():490 data = {"greeting": "Bonjour, ça va ?"}491 response = httpx.Response(200, json=data)492 assert (493 "ça va" in response.text494 ), "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 )495 assert response.headers["Content-Type"] == "application/json"496497498def test_separators_for_compact_json():499 data = {"clé": "valeur", "liste": [1, 2, 3]}500 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 )504 assert response.headers["Content-Type"] == "application/json"505506507def test_allow_nan_false():
11 unmodified lines
modified:requirements.txt+1 added-1 removed
20 unmodified lines
21coverage[toml]==7.6.122cryptography==44.0.123mypy==1.13.024pytest==8.3.425ruff==0.8.125ruff==0.12.1126trio==0.27.027trio-typing==0.10.028trustme==1.2.029uvicorn==0.32.1