Skip to content

Commit 1ed96e5

Browse files
committed
Test asyncio.get_running_loop()
1 parent 39f79e3 commit 1ed96e5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_trio_asyncio.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,14 @@ async def test_half_fixtured_asyncpg_conn(asyncio_fixture_own_loop):
3636
@pytest.mark.trio
3737
async def test_fixtured_asyncpg_conn(asyncio_fixture_with_fixtured_loop):
3838
await use_asyncio()
39+
40+
41+
@pytest.mark.trio
42+
async def test_get_running_loop():
43+
async with trio_asyncio.open_loop() as loop:
44+
try:
45+
from asyncio import get_running_loop
46+
except ImportError:
47+
pass # Python 3.6
48+
else:
49+
assert get_running_loop() == loop

0 commit comments

Comments
 (0)