fastapi/docs/zh/docs/advanced/testing-events.md

6 lines
205 B
Markdown

# 测试事件:启动 - 关闭
使用 `TestClient``with` 语句,在测试中运行事件处理器(`startup` 与 `shutdown`)。
{* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *}