We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 990e7ba commit ae0dfa4Copy full SHA for ae0dfa4
1 file changed
tests/test_run.py
@@ -0,0 +1,18 @@
1
+import qasync
2
+import asyncio
3
+import os
4
+from qasync import QApplication
5
+
6
+def test_run_with_contextmanager(application):
7
+ async def coro():
8
+ event_loop = asyncio.get_event_loop()
9
+ assert type(event_loop).__name__ == "QIOCPEventLoop" if os.name == 'nt' else "QSelectorEventLoop"
10
+ await asyncio.sleep(0)
11
12
+ qasync.run(coro())
13
14
+ try:
15
16
+ except:
17
+ event_loop = None
18
+ assert type(event_loop).__name__ != "QIOCPEventLoop" if os.name == 'nt' else "QSelectorEventLoop"
0 commit comments