diff --git a/tests/protocols/test_websocket.py b/tests/protocols/test_websocket.py index 70ced34db..366a4f0bd 100644 --- a/tests/protocols/test_websocket.py +++ b/tests/protocols/test_websocket.py @@ -568,9 +568,7 @@ async def app(scope, receive, send): disconnect_message = await receive() async def websocket_session(uri): - async with websockets.client.connect(uri): - while True: - await asyncio.sleep(0.1) + await websockets.client.connect(uri) config = Config(app=app, ws=ws_protocol_cls, http=http_protocol_cls, lifespan="off") async with run_server(config):