Skip to content

Commit 8e84324

Browse files
committed
Move alist helper outside of asyncio test package.
1 parent ec5c0d6 commit 8e84324

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

tests/asyncio/test_connection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
from websockets.protocol import CLIENT, SERVER, Protocol, State
2020

2121
from ..protocol import RecordingProtocol
22-
from ..utils import MS
22+
from ..utils import MS, alist
2323
from .connection import InterceptingConnection
24-
from .utils import alist
2524

2625

2726
# Connection implements symmetrical behavior between clients and servers.

tests/asyncio/test_messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from websockets.exceptions import ConcurrencyError
99
from websockets.frames import OP_BINARY, OP_CONT, OP_TEXT, Frame
1010

11-
from .utils import alist
11+
from ..utils import alist
1212

1313

1414
class SimpleQueueTests(unittest.IsolatedAsyncioTestCase):

tests/asyncio/test_router.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
from websockets.asyncio.router import *
99
from websockets.exceptions import InvalidStatus
1010

11-
from ..utils import CLIENT_CONTEXT, SERVER_CONTEXT, temp_unix_socket_path
11+
from ..utils import CLIENT_CONTEXT, SERVER_CONTEXT, alist, temp_unix_socket_path
1212
from .server import EvalShellMixin, get_uri, handler
13-
from .utils import alist
1413

1514

1615
try:

tests/asyncio/utils.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ def assertDeprecationWarning(self, message):
112112
self.assertEqual(str(warning.message), message)
113113

114114

115+
async def alist(async_iterable):
116+
items = []
117+
async for item in async_iterable:
118+
items.append(item)
119+
return items
120+
121+
115122
@contextlib.contextmanager
116123
def temp_unix_socket_path():
117124
with tempfile.TemporaryDirectory() as temp_dir:

0 commit comments

Comments
 (0)