Skip to content

Commit 10930b1

Browse files
authored
Merge pull request #33 from qualisys/fix_test_warning
Fixed warning from sending coroutines to asyncio.wait
2 parents 069b4af + a43c735 commit 10930b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/qtmprotocol_test.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ async def test_await_event_multiple(event_loop, qtmprotocol: QTMProtocol):
6565

6666
@pytest.mark.asyncio
6767
async def test_await_multiple(qtmprotocol: QTMProtocol):
68-
awaitable1 = qtmprotocol.await_event(event=QRTEvent.EventConnected)
69-
awaitable2 = qtmprotocol.await_event(event=QRTEvent.EventConnectionClosed)
68+
loop = asyncio.get_event_loop()
69+
awaitable1 = loop.create_task(qtmprotocol.await_event(event=QRTEvent.EventConnected))
70+
awaitable2 = loop.create_task(qtmprotocol.await_event(event=QRTEvent.EventConnectionClosed))
7071

7172
done, _ = await asyncio.wait(
7273
[awaitable1, awaitable2], return_when=asyncio.FIRST_EXCEPTION
7374
)
7475

7576
print(done)
76-
77+
7778
with pytest.raises(Exception):
7879
done.pop().result()

0 commit comments

Comments
 (0)