Skip to content

Commit

Permalink
Fix echo server
Browse files Browse the repository at this point in the history
  • Loading branch information
perklet committed Dec 27, 2023
1 parent 905cf94 commit f361e91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions tests/unittest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,12 @@ async def watch_restarts(self): # pragma: nocover


async def echo(websocket):
name = (await websocket.recv()).decode()
# print(f"<<< {name}")
while True:
name = (await websocket.recv()).decode()
# print(f"<<< {name}")

await websocket.send(name)
# print(f">>> {name}")
await websocket.send(name)
# print(f">>> {name}")


class TestWebsocketServer:
Expand Down
3 changes: 1 addition & 2 deletions tests/unittest/test_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def test_hello(ws_server):

def test_hello_twice(ws_server):
with Session() as s:
# w = s.ws_connect(ws_server.url)
w = s.ws_connect("ws://echo.websocket.events")
w = s.ws_connect(ws_server.url)

w.send(b"Bar")
reply, _ = w.recv()
Expand Down

0 comments on commit f361e91

Please sign in to comment.