Skip to content

Commit 0ca20f1

Browse files
committed
test(asyncio): set current loop
1 parent 717156e commit 0ca20f1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/integrational/asyncio/test_change_uuid.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ async def test_change_uuid_no_lock():
5656
@pytest.fixture
5757
def event_loop():
5858
loop = asyncio.new_event_loop()
59+
asyncio.set_event_loop(loop)
5960
try:
6061
yield loop
6162
finally:
6263
loop.run_until_complete(asyncio.sleep(0))
64+
asyncio.set_event_loop(None)
6365
loop.close()
6466

6567
def test_uuid_validation_at_init(event_loop):

tests/integrational/asyncio/test_message_count.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
@pytest.fixture
1212
def event_loop():
1313
loop = asyncio.new_event_loop()
14+
asyncio.set_event_loop(loop)
1415
try:
1516
yield loop
1617
finally:
1718
loop.run_until_complete(asyncio.sleep(0))
19+
asyncio.set_event_loop(None)
1820
loop.close()
1921

2022
@pytest.fixture

0 commit comments

Comments
 (0)