Home / Function/ client_fixture() — fastapi Function Reference

client_fixture() — fastapi Function Reference

Architecture documentation for the client_fixture() function in test_get_model_definitions_formfeed_escape.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  3a02e626_1717_a853_82c0_173fdbc49db1["client_fixture()"]
  f5d6c39f_edf3_f284_1d2b_a21f1c182903["test_get_model_definitions_formfeed_escape.py"]
  3a02e626_1717_a853_82c0_173fdbc49db1 -->|defined in| f5d6c39f_edf3_f284_1d2b_a21f1c182903
  style 3a02e626_1717_a853_82c0_173fdbc49db1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_get_model_definitions_formfeed_escape.py lines 8–36

def client_fixture() -> TestClient:
    from pydantic import BaseModel

    class Address(BaseModel):
        """
        This is a public description of an Address
        \f
        You can't see this part of the docstring, it's private!
        """

        line_1: str
        city: str
        state_province: str

    class Facility(BaseModel):
        id: str
        address: Address

    app = FastAPI()

    @app.get("/facilities/{facility_id}")
    def get_facility(facility_id: str) -> Facility:
        return Facility(
            id=facility_id,
            address=Address(line_1="123 Main St", city="Anytown", state_province="CA"),
        )

    client = TestClient(app)
    return client

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free