Skip to content

Commit a1c9df2

Browse files
authored
Create test_run.py
1 parent 292c077 commit a1c9df2

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/test_run.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import qasync
2+
import asyncio
3+
4+
def test_run_with_contextmanager():
5+
async def coro():
6+
event_loop = asyncio.get_event_loop()
7+
assert type(event_loop).__name__ == "QSelectorEventLoop"
8+
await asyncio.sleep(0)
9+
10+
qasync.run(coro())
11+
12+
event_loop = asyncio.get_event_loop()
13+
assert type(event_loop).__name__ != "QSelectorEventLoop"

0 commit comments

Comments
 (0)