Skip to content

Commit 663b561

Browse files
committed
Reorder imports to address code quality (tox)
Running tox revealed that the "Sync connection tracking and graceful shutdown" patch introduced "misordered import statements" warning and unused assignments (client) in "with connect(...) as client:" in the added tests. This commit addresses these code quality messages.
1 parent fd31b2a commit 663b561

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/sync/test_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import time
88
import unittest
99

10+
from websockets import CloseCode
1011
from websockets.exceptions import (
1112
ConnectionClosedError,
1213
ConnectionClosedOK,
1314
InvalidStatus,
1415
NegotiationError,
1516
)
16-
from websockets import CloseCode, State
1717
from websockets.http11 import Request, Response
1818
from websockets.sync.client import connect, unix_connect
1919
from websockets.sync.server import *
@@ -352,7 +352,7 @@ def test_connections_is_empty_after_disconnects(self):
352352
"""Clients are added to Server._connections, and removed when disconnected."""
353353
with run_server() as server:
354354
connections: set[ServerConnection] = server._connections
355-
with connect(get_uri(server)) as client:
355+
with connect(get_uri(server)):
356356
self.assertEqual(len(connections), 1)
357357
time.sleep(0.5)
358358
self.assertEqual(len(connections), 0)
@@ -382,7 +382,7 @@ def close(self, code=CloseCode.NORMAL_CLOSURE, reason=""):
382382
with run_server(create_connection=ServerConnectionWithBrokenClose) as server:
383383

384384
def client():
385-
with connect(get_uri(server)) as client:
385+
with connect(get_uri(server)):
386386
time.sleep(1)
387387

388388
for i in range(CLIENTS_TO_LAUNCH):

0 commit comments

Comments
 (0)