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

17 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from typing import Annotated 1cbd

2 

3from fastapi import Depends 1cbd

4 

5 

6async def dependency_a(): 1cbd

7 dep_a = generate_dep_a() 1a

8 try: 1a

9 yield dep_a 1a

10 finally: 

11 dep_a.close() 1a

12 

13 

14async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]): 1cbad

15 dep_b = generate_dep_b() 1a

16 try: 1a

17 yield dep_b 1a

18 finally: 

19 dep_b.close(dep_a) 1a

20 

21 

22async def dependency_c(dep_b: Annotated[DepB, Depends(dependency_b)]): 1ba

23 dep_c = generate_dep_c() 1a

24 try: 1a

25 yield dep_c 1a

26 finally: 

27 dep_c.close(dep_b) 1a