File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 22from textwrap import dedent
33
44import pytest
5+ from pytest import Pytester
56
67import pytest_asyncio
78
@@ -43,8 +44,9 @@ async def test_fixture_with_params(fixture_with_params):
4344
4445
4546@pytest .mark .parametrize ("mode" , ("auto" , "strict" ))
46- def test_sync_function_uses_async_fixture (testdir , mode ):
47- testdir .makepyfile (
47+ def test_sync_function_uses_async_fixture (pytester : Pytester , mode ):
48+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
49+ pytester .makepyfile (
4850 dedent (
4951 """\
5052 import pytest_asyncio
@@ -60,5 +62,5 @@ def test_sync_function_uses_async_fixture(always_true):
6062 """
6163 )
6264 )
63- result = testdir .runpytest (f"--asyncio-mode={ mode } " )
65+ result = pytester .runpytest (f"--asyncio-mode={ mode } " )
6466 result .assert_outcomes (passed = 1 )
You can’t perform that action at this time.
0 commit comments