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.

421 B

测试 WebSockets

测试 WebSockets 也使用 TestClient

为此,要在 with 语句中使用 TestClient 连接 WebSocket。

{!../../../docs_src/app_testing/tutorial002.py!}

/// note | "笔记"

更多细节详见 Starlette 官档 - 测试 WebSockets

///