Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sanic_testing/websocket.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing

from websockets.exceptions import ConnectionClosedOK
from websockets.legacy.client import connect
from websockets.asyncio.client import connect


class WebsocketProxy:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from sanic import Sanic, Websocket
from sanic.request import Request
from websockets.client import WebSocketClientProtocol
from websockets.asyncio.client import ClientConnection


@pytest.mark.parametrize(
Expand Down Expand Up @@ -33,7 +33,7 @@ async def handler(request, ws):


def test_websocket_route_queue(app: Sanic):
async def client_mimic(websocket: WebSocketClientProtocol):
async def client_mimic(websocket: ClientConnection):
await websocket.send("foo")
await websocket.recv()

Expand All @@ -54,7 +54,7 @@ def test_websocket_client_mimic_failed(app: Sanic):
async def handler(request, ws: Websocket):
pass

async def client_mimic(websocket: WebSocketClientProtocol):
async def client_mimic(websocket: ClientConnection):
raise Exception("Should fails")

with pytest.raises(Exception, match="Should fails"):
Expand Down