Coverage for docs_src/custom_response/tutorial007.py: 100%
9 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from fastapi import FastAPI 1abcde
2from fastapi.responses import StreamingResponse 1abcde
4app = FastAPI() 1abcde
7async def fake_video_streamer(): 1abcde
8 for i in range(10): 1abcde
9 yield b"some fake video bytes" 1abcde
12@app.get("/") 1abcde
13async def main(): 1abcde
14 return StreamingResponse(fake_video_streamer()) 1abcde