Skip to content

Commit aa79c6e

Browse files
committed
Avoid using deprecated run_asyncio
I guess this will break in the future as we work through python-trio/trio-asyncio#42 but right now I don't care I just want these freaking tests to pass.
1 parent 36f087f commit aa79c6e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: pytest_trio/_tests/test_trio_asyncio.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
pytestmark = pytest.mark.skip(reason="trio-asyncio not available")
1010

1111

12-
async def use_run_asyncio():
13-
await trio_asyncio.run_asyncio(asyncio.sleep, 0)
12+
async def use_asyncio():
13+
await trio_asyncio.aio_as_trio(asyncio.sleep)(0)
1414

1515

1616
@pytest.fixture()
@@ -23,29 +23,29 @@ async def asyncio_loop():
2323
@pytest.fixture()
2424
@async_generator
2525
async def asyncio_fixture_with_fixtured_loop(asyncio_loop):
26-
await use_run_asyncio()
26+
await use_asyncio()
2727
await yield_()
2828

2929

3030
@pytest.fixture()
3131
@async_generator
3232
async def asyncio_fixture_own_loop():
3333
async with trio_asyncio.open_loop():
34-
await use_run_asyncio()
34+
await use_asyncio()
3535
await yield_()
3636

3737

3838
@pytest.mark.trio
3939
async def test_no_fixture():
4040
async with trio_asyncio.open_loop():
41-
await use_run_asyncio()
41+
await use_asyncio()
4242

4343

4444
@pytest.mark.trio
4545
async def test_half_fixtured_asyncpg_conn(asyncio_fixture_own_loop):
46-
await use_run_asyncio()
46+
await use_asyncio()
4747

4848

4949
@pytest.mark.trio
5050
async def test_fixtured_asyncpg_conn(asyncio_fixture_with_fixtured_loop):
51-
await use_run_asyncio()
51+
await use_asyncio()

0 commit comments

Comments
 (0)