failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) ยท None tool calls ยท 0 s ยท fastapi/fastapi
๐ Fix security schemes in OpenAPI when added at the top level app ๐ Fix security schemes in OpenAPI when added at the top level app Ref: https://github.com/fastapi/fastapi/discussions/14263 Ref: https://github.com/fastapi/fastapi/issues/14271
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||
..FE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ inline-snapshot โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Fix snapshots โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโโโโโโโโโโโโโ tests/test_top_level_security_scheme_in_openapi.py โโโโโโโโโโโโโโฎ
โ @@ -48,13 +48,7 @@ โ
โ โ
โ "description": "Successful Response", โ
โ "content": {"application/json": {"schema": โ
โ {}}}, โ
โ } โ
โ - }, โ
โ - "security": [{"HTTPBearer": []}], โ
โ - } โ
โ + }} โ
โ } โ
โ - }, โ
โ - "components": { โ
โ - "securitySchemes": {"HTTPBearer": {"type": "http", โ
โ "scheme": "bearer"}} โ
โ - }, โ
โ - } โ
โ + }} โ
โ ) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
These changes are not applied.
Use --inline-snapshot=fix to apply them, or use the interactive mode with
--inline-snapshot=review
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Problems โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
inline-snapshot is not able to format your code.
This issue can be solved by:
* installing inline-snapshot[black] which gives you the same formatting like in
older versions
* adding a `format-command` to your pyproject.toml (see
https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command
for more information).
==================================== ERRORS ====================================
___________________ ERROR at teardown of test_openapi_schema ___________________
some snapshots in this test have incorrect values.
If you just created this value with --inline-snapshot=create, the value is now created and you can ignore this message.
=================================== FAILURES ===================================
_____________________________ test_openapi_schema ______________________________
def test_openapi_schema():
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
> assert response.json() == snapshot(
{
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/": {
"get": {
"summary": "Get Root",
"operationId": "get_root__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
}
},
"security": [{"HTTPBearer": []}],
}
}
},
"components": {
"securitySchemes": {"HTTPBearer": {"type": "http", "scheme": "bearer"}}
},
}
)
E AssertionError: assert {'openapi': '...': {...}}}}}}} == {'openapi': '...: 'bearer'}}}}
E
E Omitting 2 identical items, use -vv to show
E Differing items:
E {'paths': {'/': {'get': {'summary': 'Get Root', 'operationId': 'get_root__get', 'responses': {'200': {'description': 'Successful Response', 'content': {...}}}}}}} != {'paths': {'/': {'get': {'summary': 'Get Root', 'operationId': 'get_root__get', 'responses': {'200': {'description': 'Successful Response', 'content': {...}}}, 'security': [{'HTTPBearer': []}]}}}}
E Right contains 1 more item:
E {'components': {'securitySchemes': {'HTTPBearer': {'scheme': 'bearer',
E 'type': 'http'}}}}
E Use -v to get more diff
tests/test_top_level_security_scheme_in_openapi.py:37: AssertionError
=============================== warnings summary ===============================
../../../../../../../Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/overlays/starlette-0.49.3-py3-none-any/starlette/testclient.py:51
/Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/overlays/starlette-0.49.3-py3-none-any/starlette/testclient.py:51: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.
_PortalFactoryType = Callable[[], AbstractContextManager[anyio.abc.BlockingPortal]]
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 2 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 2 passed, 1 warning, 1 error in 0.64s