Skip to content

Commit

Permalink
Change localhost to 127.0.0.1 in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
perkfly committed Dec 25, 2023
1 parent e745862 commit 5069ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unittest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ async def echo(websocket):

class TestWebsocketServer:
def __init__(self, port):
self.url = f"ws://localhost:{port}"
self.url = f"ws://127.0.0.1:{port}"
self.port = port

def run(self):
async def serve(port):
async with websockets.serve(echo, "localhost", port):
async with websockets.serve(echo, "127.0.0.1", port):
await asyncio.Future() # run forever

asyncio.run(serve(self.port))
Expand Down

0 comments on commit 5069ea7

Please sign in to comment.