(test_client_factory: TestClientFactory)
| 494 | |
| 495 | |
| 496 | def test_duplicate_disconnect(test_client_factory: TestClientFactory) -> None: |
| 497 | async def app(scope: Scope, receive: Receive, send: Send) -> None: |
| 498 | websocket = WebSocket(scope, receive=receive, send=send) |
| 499 | await websocket.accept() |
| 500 | message = await websocket.receive() |
| 501 | assert message["type"] == "websocket.disconnect" |
| 502 | message = await websocket.receive() |
| 503 | |
| 504 | client = test_client_factory(app) |
| 505 | with pytest.raises(RuntimeError): |
| 506 | with client.websocket_connect("/") as websocket: |
| 507 | websocket.close() |
| 508 | |
| 509 | |
| 510 | def test_websocket_scope_interface() -> None: |
nothing calls this directly
no test coverage detected