()
| 10 | |
| 11 | @pytest.fixture(name="client") |
| 12 | def get_client(): |
| 13 | from enum import Enum |
| 14 | |
| 15 | app = FastAPI() |
| 16 | |
| 17 | class PlatformRole(str, Enum): |
| 18 | admin = "admin" |
| 19 | user = "user" |
| 20 | |
| 21 | class OtherRole(str, Enum): ... |
| 22 | |
| 23 | class User(BaseModel): |
| 24 | username: str |
| 25 | role: PlatformRole | OtherRole |
| 26 | |
| 27 | @app.get("/users") |
| 28 | async def get_user() -> User: |
| 29 | return {"username": "alice", "role": "admin"} # ty: ignore[invalid-return-type] |
| 30 | |
| 31 | client = TestClient(app) |
| 32 | return client |
| 33 | |
| 34 | |
| 35 | @needs_py310 |
nothing calls this directly
no test coverage detected
searching dependent graphs…