You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two tests fail with Python 3.13.0b2 on a missing key 'content-type'. I run then during the RPM build on version 0.37.2. @musicinmybrain reports it can be reproduced via a virtual environment: pip install -e .[full]; pip install -r requirements.txt; pip install --update trio; python -m pytest)
___________________________ test_debug_html[asyncio] ___________________________
test_client_factory = functools.partial(<class 'starlette.testclient.TestClient'>, backend='asyncio', backend_options={})
def test_debug_html(test_client_factory: TestClientFactory) -> None:
async def app(scope: Scope, receive: Receive, send: Send) -> None:
raise RuntimeError("Something went wrong")
app = ServerErrorMiddleware(app, debug=True)
client = test_client_factory(app, raise_server_exceptions=False)
response = client.get("/", headers={"Accept": "text/html, */*"})
assert response.status_code == 500
> assert response.headers["content-type"].startswith("text/html")
tests/middleware/test_errors.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Headers({}), key = 'content-type'
def __getitem__(self, key: str) -> str:
"""
Return a single header value.
If there are multiple headers with the same key, then we concatenate
them with commas. See: https://tools.ietf.org/html/rfc7230#section-3.2.2
"""
normalized_key = key.lower().encode(self.encoding)
items = [
header_value.decode(self.encoding)
for _, header_key, header_value in self._list
if header_key == normalized_key
]
if items:
return ", ".join(items)
> raise KeyError(key)
E KeyError: 'content-type'
/usr/lib/python3.13/site-packages/httpx/_models.py:228: KeyError
____________________________ test_debug_html[trio] _____________________________
test_client_factory = functools.partial(<class 'starlette.testclient.TestClient'>, backend='trio', backend_options={})
def test_debug_html(test_client_factory: TestClientFactory) -> None:
async def app(scope: Scope, receive: Receive, send: Send) -> None:
raise RuntimeError("Something went wrong")
app = ServerErrorMiddleware(app, debug=True)
client = test_client_factory(app, raise_server_exceptions=False)
response = client.get("/", headers={"Accept": "text/html, */*"})
assert response.status_code == 500
> assert response.headers["content-type"].startswith("text/html")
tests/middleware/test_errors.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Headers({}), key = 'content-type'
def __getitem__(self, key: str) -> str:
"""
Return a single header value.
If there are multiple headers with the same key, then we concatenate
them with commas. See: https://tools.ietf.org/html/rfc7230#section-3.2.2
"""
normalized_key = key.lower().encode(self.encoding)
items = [
header_value.decode(self.encoding)
for _, header_key, header_value in self._list
if header_key == normalized_key
]
if items:
return ", ".join(items)
> raise KeyError(key)
E KeyError: 'content-type'
/usr/lib/python3.13/site-packages/httpx/_models.py:228: KeyError
Two tests fail with Python 3.13.0b2 on a missing key 'content-type'. I run then during the RPM build on version 0.37.2.
@musicinmybrain reports it can be reproduced via a virtual environment:
pip install -e .[full]; pip install -r requirements.txt; pip install --update trio; python -m pytest
)Important
The text was updated successfully, but these errors were encountered: