test_exception_handler_body_access() — fastapi Function Reference
Architecture documentation for the test_exception_handler_body_access() function in test_tutorial002.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD a04a91ad_fe7e_76da_bb9f_ba066b4e8911["test_exception_handler_body_access()"] bedb46ee_b302_74dc_f41f_119018ee2df4["test_tutorial002.py"] a04a91ad_fe7e_76da_bb9f_ba066b4e8911 -->|defined in| bedb46ee_b302_74dc_f41f_119018ee2df4 style a04a91ad_fe7e_76da_bb9f_ba066b4e8911 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py lines 31–46
def test_exception_handler_body_access(client: TestClient):
response = client.post("/", json={"numbers": [1, 2, 3]})
assert response.json() == {
"detail": {
"errors": [
{
"type": "list_type",
"loc": ["body"],
"msg": "Input should be a valid list",
"input": {"numbers": [1, 2, 3]},
}
],
# httpx 0.28.0 switches to compact JSON https://github.com/encode/httpx/issues/3363
"body": IsOneOf('{"numbers": [1, 2, 3]}', '{"numbers":[1,2,3]}'),
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_exception_handler_body_access() do?
test_exception_handler_body_access() is a function in the fastapi codebase, defined in tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py.
Where is test_exception_handler_body_access() defined?
test_exception_handler_body_access() is defined in tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py at line 31.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free