Skip to content

Commit 2c0e996

Browse files
committed
Stop using old event_loop fixture.
1 parent 5d8c84b commit 2c0e996

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tests/test_pubsub.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

tests/test_pubsub_sentinel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)