mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-08 03:26:48 +00:00
9 lines
243 B
Markdown
9 lines
243 B
Markdown
## Testing WebSockets
|
|
|
|
You can use the same `TestClient` to test WebSockets.
|
|
|
|
For this, you use the `TestClient` in a `with` statement, connecting to the WebSocket:
|
|
|
|
```Python hl_lines="27 28 29 30 31"
|
|
{!./src/app_testing/tutorial002.py!}
|
|
```
|