Coverage for docs_src / custom_response / tutorial007_py310.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-04-06 01:24 +0000

1import anyio 1abcd

2from fastapi import FastAPI 1abcd

3from fastapi.responses import StreamingResponse 1abcd

4 

5app = FastAPI() 1abcd

6 

7 

8async def fake_video_streamer(): 1abcd

9 for i in range(10): 1efgh

10 yield b"some fake video bytes" 1efgh

11 await anyio.sleep(0) 1efgh

12 

13 

14@app.get("/") 1abcd

15async def main(): 1abcd

16 return StreamingResponse(fake_video_streamer()) 1efgh