Coverage for docs_src/dependencies/tutorial001_py310.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-04 08:29 +0000

1from fastapi import Depends, FastAPI 1abcde

2 

3app = FastAPI() 1abcde

4 

5 

6async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100): 1abcde

7 return {"q": q, "skip": skip, "limit": limit} 1fghij

8 

9 

10@app.get("/items/") 1abcde

11async def read_items(commons: dict = Depends(common_parameters)): 1abcde

12 return commons 1fghij

13 

14 

15@app.get("/users/") 1abcde

16async def read_users(commons: dict = Depends(common_parameters)): 1abcde

17 return commons 1fghij