Testing Events: startup - shutdown
When you need your event handlers (startup and shutdown) to run in your tests, you can use the TestClient with a with statement:
{!../../../docs_src/app_testing/tutorial003.py!}
FastAPI framework, high performance, easy to learn, fast to code, ready for production We just scratched the surface, but you already get the idea of how it all works...
When you need your event handlers (startup and shutdown) to run in your tests, you can use the TestClient with a with statement:
{!../../../docs_src/app_testing/tutorial003.py!}