1111from  unittest .mock  import  MagicMock 
1212
1313import  pytest 
14+ import  pytest_asyncio 
1415
1516from  pytest_mock  import  MockerFixture 
1617from  pytest_mock  import  PytestMockWarning 
@@ -475,7 +476,7 @@ def __call__(self, x):
475476    assert  spy .spy_return  ==  20 
476477
477478
478- @pytest . mark . asyncio  
479+ @pytest_asyncio . fixture  
479480async  def  test_instance_async_method_spy (mocker : MockerFixture ) ->  None :
480481    class  Foo :
481482        async  def  bar (self , arg ):
@@ -728,6 +729,12 @@ def test_foo(mocker):
728729@pytest .mark .usefixtures ("needs_assert_rewrite" ) 
729730def  test_detailed_introspection (testdir : Any ) ->  None :
730731    """Check that the "mock_use_standalone" is being used.""" 
732+     testdir .makeini (
733+         """ 
734+         [pytest] 
735+         asyncio_mode=strict 
736+         """ 
737+     )
731738    testdir .makepyfile (
732739        """ 
733740        def test(mocker): 
@@ -769,11 +776,18 @@ def test(mocker):
769776@pytest .mark .usefixtures ("needs_assert_rewrite" ) 
770777def  test_detailed_introspection_async (testdir : Any ) ->  None :
771778    """Check that the "mock_use_standalone" is being used.""" 
779+     testdir .makeini (
780+         """ 
781+         [pytest] 
782+         asyncio_mode=strict 
783+         """ 
784+     )
772785    testdir .makepyfile (
773786        """ 
774787        import pytest 
788+         import pytest_asyncio 
775789
776-         @pytest.mark.asyncio  
790+         @pytest_asyncio.fixture  
777791        async def test(mocker): 
778792            m = mocker.AsyncMock() 
779793            await m('fo') 
@@ -824,6 +838,12 @@ def test_assert_called_with_unicode_arguments(mocker: MockerFixture) -> None:
824838
825839def  test_plain_stopall (testdir : Any ) ->  None :
826840    """patch.stopall() in a test should not cause an error during unconfigure (#137)""" 
841+     testdir .makeini (
842+         """ 
843+         [pytest] 
844+         asyncio_mode=strict 
845+         """ 
846+     )
827847    testdir .makepyfile (
828848        """ 
829849        import random 
@@ -958,6 +978,12 @@ def test_foo(mocker):
958978
959979
960980def  test_used_with_class_scope (testdir : Any ) ->  None :
981+     testdir .makeini (
982+         """ 
983+         [pytest] 
984+         asyncio_mode=strict 
985+         """ 
986+     )
961987    testdir .makepyfile (
962988        """ 
963989        import pytest 
@@ -982,6 +1008,12 @@ def test_get_random_number(self):
9821008
9831009
9841010def  test_used_with_module_scope (testdir : Any ) ->  None :
1011+     testdir .makeini (
1012+         """ 
1013+         [pytest] 
1014+         asyncio_mode=strict 
1015+         """ 
1016+     )
9851017    testdir .makepyfile (
9861018        """ 
9871019        import pytest 
@@ -1004,7 +1036,12 @@ def test_get_random_number():
10041036
10051037
10061038def  test_used_with_package_scope (testdir : Any ) ->  None :
1007-     """...""" 
1039+     testdir .makeini (
1040+         """ 
1041+         [pytest] 
1042+         asyncio_mode=strict 
1043+         """ 
1044+     )
10081045    testdir .makepyfile (
10091046        """ 
10101047        import pytest 
@@ -1027,7 +1064,12 @@ def test_get_random_number():
10271064
10281065
10291066def  test_used_with_session_scope (testdir : Any ) ->  None :
1030-     """...""" 
1067+     testdir .makeini (
1068+         """ 
1069+         [pytest] 
1070+         asyncio_mode=strict 
1071+         """ 
1072+     )
10311073    testdir .makepyfile (
10321074        """ 
10331075        import pytest 
0 commit comments