Home / Function/ test_typing() — fastapi Function Reference

test_typing() — fastapi Function Reference

Architecture documentation for the test_typing() function in test_typing_python39.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  d3714ab7_6a8f_26c2_e562_58be60d4a8aa["test_typing()"]
  db11ce81_bd4c_f710_d256_3b64519b59d4["test_typing_python39.py"]
  d3714ab7_6a8f_26c2_e562_58be60d4a8aa -->|defined in| db11ce81_bd4c_f710_d256_3b64519b59d4
  style d3714ab7_6a8f_26c2_e562_58be60d4a8aa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_typing_python39.py lines 8–24

def test_typing():
    types = {
        list[int]: [1, 2, 3],
        dict[str, list[int]]: {"a": [1, 2, 3], "b": [4, 5, 6]},
        set[int]: [1, 2, 3],  # `set` is converted to `list`
        tuple[int, ...]: [1, 2, 3],  # `tuple` is converted to `list`
    }
    for test_type, expect in types.items():
        app = FastAPI()

        @app.post("/", response_model=test_type)
        def post_endpoint(input: test_type):
            return input

        res = TestClient(app).post("/", json=expect)
        assert res.status_code == 200, res.json()
        assert res.json() == expect

Domain

Subdomains

Frequently Asked Questions

What does test_typing() do?
test_typing() is a function in the fastapi codebase, defined in tests/test_typing_python39.py.
Where is test_typing() defined?
test_typing() is defined in tests/test_typing_python39.py at line 8.

Analyze Your Own Codebase

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

Try Supermodel Free