You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

634 B

Eventos de testing: lifespan y startup - shutdown

Cuando necesitas que lifespan se ejecute en tus tests, puedes usar el TestClient con un statement with:

{* ../../docs_src/app_testing/tutorial004_py310.py hl[9:15,18,27:28,30:32,41:43] *}

Puedes leer más detalles sobre "Ejecutar lifespan en tests en el sitio oficial de documentación de Starlette."

Para los eventos obsoletos startup y shutdown, puedes usar el TestClient así:

{* ../../docs_src/app_testing/tutorial003_py310.py hl[9:12,20:24] *}