Skip to content

Commit 42f718f

Browse files
committed
move RaisesGroup import
1 parent 0119442 commit 42f718f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: tests/test_connection.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
except ImportError:
5151
from trio.hazmat import current_task # type: ignore # pylint: disable=ungrouped-imports
5252

53+
54+
# only available on trio>=0.25, we don't use it when testing lower versions
55+
try:
56+
from trio.testing import RaisesGroup
57+
except ImportError:
58+
pass
59+
5360
from trio_websocket import (
5461
connect_websocket,
5562
connect_websocket_url,
@@ -460,7 +467,6 @@ async def handler(request):
460467
# 2. WebSocketServer.run
461468
# 3. trio.serve_listeners
462469
# 4. WebSocketServer._handle_connection
463-
from trio.testing import RaisesGroup # pylint: disable=import-outside-toplevel
464470
assert RaisesGroup(
465471
RaisesGroup(
466472
RaisesGroup(

0 commit comments

Comments
 (0)