Home / Function/ test_nested_router() — fastapi Function Reference

test_nested_router() — fastapi Function Reference

Architecture documentation for the test_nested_router() function in test_annotated.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  55371d51_3708_8e8d_844c_44ca3c644944["test_nested_router()"]
  ebdf85eb_0692_0882_dd01_47bca11b24da["test_annotated.py"]
  55371d51_3708_8e8d_844c_44ca3c644944 -->|defined in| ebdf85eb_0692_0882_dd01_47bca11b24da
  style 55371d51_3708_8e8d_844c_44ca3c644944 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_annotated.py lines 103–118

def test_nested_router():
    app = FastAPI()

    router = APIRouter(prefix="/nested")

    @router.get("/test")
    async def test(var: Annotated[str, Query()] = "bar"):
        return {"foo": var}

    app.include_router(router)

    client = TestClient(app)

    response = client.get("/nested/test")
    assert response.status_code == 200
    assert response.json() == {"foo": "bar"}

Domain

Subdomains

Frequently Asked Questions

What does test_nested_router() do?
test_nested_router() is a function in the fastapi codebase, defined in tests/test_annotated.py.
Where is test_nested_router() defined?
test_nested_router() is defined in tests/test_annotated.py at line 103.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free