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): 
@@ -772,8 +779,9 @@ def test_detailed_introspection_async(testdir: Any) -> None:
772779    testdir .makepyfile (
773780        """ 
774781        import pytest 
782+         import pytest_asyncio 
775783
776-         @pytest.mark.asyncio  
784+         @pytest_asyncio.fixture  
777785        async def test(mocker): 
778786            m = mocker.AsyncMock() 
779787            await m('fo') 
@@ -824,6 +832,12 @@ def test_assert_called_with_unicode_arguments(mocker: MockerFixture) -> None:
824832
825833def  test_plain_stopall (testdir : Any ) ->  None :
826834    """patch.stopall() in a test should not cause an error during unconfigure (#137)""" 
835+     testdir .makeini (
836+         """ 
837+         [pytest] 
838+         asyncio_mode=strict 
839+         """ 
840+     )
827841    testdir .makepyfile (
828842        """ 
829843        import random 
@@ -958,6 +972,12 @@ def test_foo(mocker):
958972
959973
960974def  test_used_with_class_scope (testdir : Any ) ->  None :
975+     testdir .makeini (
976+         """ 
977+         [pytest] 
978+         asyncio_mode=strict 
979+         """ 
980+     )
961981    testdir .makepyfile (
962982        """ 
963983        import pytest 
@@ -982,6 +1002,12 @@ def test_get_random_number(self):
9821002
9831003
9841004def  test_used_with_module_scope (testdir : Any ) ->  None :
1005+     testdir .makeini (
1006+         """ 
1007+         [pytest] 
1008+         asyncio_mode=strict 
1009+         """ 
1010+     )
9851011    testdir .makepyfile (
9861012        """ 
9871013        import pytest 
@@ -1004,7 +1030,12 @@ def test_get_random_number():
10041030
10051031
10061032def  test_used_with_package_scope (testdir : Any ) ->  None :
1007-     """...""" 
1033+     testdir .makeini (
1034+         """ 
1035+         [pytest] 
1036+         asyncio_mode=strict 
1037+         """ 
1038+     )
10081039    testdir .makepyfile (
10091040        """ 
10101041        import pytest 
@@ -1027,7 +1058,12 @@ def test_get_random_number():
10271058
10281059
10291060def  test_used_with_session_scope (testdir : Any ) ->  None :
1030-     """...""" 
1061+     testdir .makeini (
1062+         """ 
1063+         [pytest] 
1064+         asyncio_mode=strict 
1065+         """ 
1066+     )
10311067    testdir .makepyfile (
10321068        """ 
10331069        import pytest 
0 commit comments