File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ async def test_send_receive(channel_layer):
6161 assert message ["text" ] == "Ahoy-hoy!"
6262
6363
64- def test_send_receive_sync (channel_layer , event_loop ):
64+ # @pytest.mark.asyncio(scope="module")
65+ def test_send_receive_sync (channel_layer ):
66+ event_loop = asyncio .new_event_loop ()
6567 _await = event_loop .run_until_complete
6668 channel = _await (channel_layer .new_channel ())
6769 async_to_sync (channel_layer .send , force_new_loop = True )(
@@ -86,7 +88,8 @@ async def test_multi_send_receive(channel_layer):
8688 assert (await channel_layer .receive (channel ))["type" ] == "message.3"
8789
8890
89- def test_multi_send_receive_sync (channel_layer , event_loop ):
91+ def test_multi_send_receive_sync (channel_layer ):
92+ event_loop = asyncio .new_event_loop ()
9093 _await = event_loop .run_until_complete
9194 channel = _await (channel_layer .new_channel ())
9295 send = async_to_sync (channel_layer .send )
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ async def test_send_receive(channel_layer):
4242 assert message ["text" ] == "Ahoy-hoy!"
4343
4444
45- def test_send_receive_sync (channel_layer , event_loop ):
45+ def test_send_receive_sync (channel_layer ):
46+ event_loop = asyncio .new_event_loop ()
4647 _await = event_loop .run_until_complete
4748 channel = _await (channel_layer .new_channel ())
4849 async_to_sync (channel_layer .send , force_new_loop = True )(
@@ -67,7 +68,8 @@ async def test_multi_send_receive(channel_layer):
6768 assert (await channel_layer .receive (channel ))["type" ] == "message.3"
6869
6970
70- def test_multi_send_receive_sync (channel_layer , event_loop ):
71+ def test_multi_send_receive_sync (channel_layer ):
72+ event_loop = asyncio .new_event_loop ()
7173 _await = event_loop .run_until_complete
7274 channel = _await (channel_layer .new_channel ())
7375 send = async_to_sync (channel_layer .send )
You can’t perform that action at this time.
0 commit comments