All quizzesHard
Scopes, Cleanup & Testing — Series 2
Preview — 3 of 10 questions
A yield dependency appends "open" before yield and "close" in finally; the route appends "handler". What is the order for a normal request?
Aopen, handler, close
Bhandler, open, close
Copen, close, handler
Dclose, open, handler
A yield dependency creates a temporary resource, then the route raises an exception. Where should resource cleanup be placed?
AOnly after the route's return
BOnly in the OpenAPI generator
CIn a finally block around yield
DIn a browser callback
A yield dependency catches ValueError thrown by the route, logs it, and then silently returns. What is the risk?
AThe dependency runs twice automatically
BFastAPI may no longer see the original exception
COpenAPI always reports a 409 response
DThe route is retried in a threadpool
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.