failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · fastapi/fastapi
(not found in data/tasks.jsonl)
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||
....................F
=================================== FAILURES ===================================
________ test_frontend_dependency_response_headers_and_background_tasks ________
tmp_path = PosixPath('/private/tmp/swe_work/mined_baseline/fastapi_16105/tmp/pytest-of-jp/pytest-0/test_frontend_dependency_respo0')
def test_frontend_dependency_response_headers_and_background_tasks(tmp_path: Path):
calls: list[str] = []
def frontend_dependency(
response: Response, background_tasks: BackgroundTasks
) -> None:
response.headers["X-Frontend-Dependency"] = "applied"
response.set_cookie("frontend", "dependency")
background_tasks.add_task(calls.append, "background")
dist = tmp_path / "dist"
write_file(dist / "index.html", "app")
app = FastAPI(dependencies=[Depends(frontend_dependency)])
app.frontend("/", directory=dist)
response = TestClient(app).get("/")
assert response.status_code == 200
assert response.text == "app"
> assert response.headers["X-Frontend-Dependency"] == "applied"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_frontend.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Headers({'content-type': 'text/html; charset=utf-8', 'accept-ranges': 'bytes', 'content-length': '3', 'last-modified': 'Thu, 24 Sep 2026 03:56:38 GMT', 'etag': '"9a29d3b2e8309daa0df64a28061f47c1"'})
key = 'X-Frontend-Dependency'
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: 'X-Frontend-Dependency'
/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/fastapi/lib/python3.13/site-packages/httpx2/_models.py:325: KeyError
=============================== warnings summary ===============================
../../../../../../Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/overlays/starlette-1.6.0-py3-none-any/starlette/testclient.py:53
/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/overlays/starlette-1.6.0-py3-none-any/starlette/testclient.py:53: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.
_PortalFactoryType = Callable[[], AbstractContextManager[anyio.abc.BlockingPortal]]
tests/test_frontend.py:550
/private/tmp/swe_work/mined_baseline/fastapi_16105/workspace/tests/test_frontend.py:550: PytestUnknownMarkWarning: Unknown pytest.mark.anyio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.anyio
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 20 passed, 2 warnings in 0.67s