@@ -475,7 +475,6 @@ def __call__(self, x):
475
475
assert spy .spy_return == 20
476
476
477
477
478
- @pytest .mark .asyncio
479
478
async def test_instance_async_method_spy (mocker : MockerFixture ) -> None :
480
479
class Foo :
481
480
async def bar (self , arg ):
@@ -728,6 +727,12 @@ def test_foo(mocker):
728
727
@pytest .mark .usefixtures ("needs_assert_rewrite" )
729
728
def test_detailed_introspection (testdir : Any ) -> None :
730
729
"""Check that the "mock_use_standalone" is being used."""
730
+ testdir .makeini (
731
+ """
732
+ [pytest]
733
+ asyncio_mode=auto
734
+ """
735
+ )
731
736
testdir .makepyfile (
732
737
"""
733
738
def test(mocker):
@@ -769,11 +774,16 @@ def test(mocker):
769
774
@pytest .mark .usefixtures ("needs_assert_rewrite" )
770
775
def test_detailed_introspection_async (testdir : Any ) -> None :
771
776
"""Check that the "mock_use_standalone" is being used."""
777
+ testdir .makeini (
778
+ """
779
+ [pytest]
780
+ asyncio_mode=auto
781
+ """
782
+ )
772
783
testdir .makepyfile (
773
784
"""
774
785
import pytest
775
786
776
- @pytest.mark.asyncio
777
787
async def test(mocker):
778
788
m = mocker.AsyncMock()
779
789
await m('fo')
@@ -824,6 +834,12 @@ def test_assert_called_with_unicode_arguments(mocker: MockerFixture) -> None:
824
834
825
835
def test_plain_stopall (testdir : Any ) -> None :
826
836
"""patch.stopall() in a test should not cause an error during unconfigure (#137)"""
837
+ testdir .makeini (
838
+ """
839
+ [pytest]
840
+ asyncio_mode=auto
841
+ """
842
+ )
827
843
testdir .makepyfile (
828
844
"""
829
845
import random
@@ -958,6 +974,12 @@ def test_foo(mocker):
958
974
959
975
960
976
def test_used_with_class_scope (testdir : Any ) -> None :
977
+ testdir .makeini (
978
+ """
979
+ [pytest]
980
+ asyncio_mode=auto
981
+ """
982
+ )
961
983
testdir .makepyfile (
962
984
"""
963
985
import pytest
@@ -982,6 +1004,12 @@ def test_get_random_number(self):
982
1004
983
1005
984
1006
def test_used_with_module_scope (testdir : Any ) -> None :
1007
+ testdir .makeini (
1008
+ """
1009
+ [pytest]
1010
+ asyncio_mode=auto
1011
+ """
1012
+ )
985
1013
testdir .makepyfile (
986
1014
"""
987
1015
import pytest
@@ -1004,7 +1032,12 @@ def test_get_random_number():
1004
1032
1005
1033
1006
1034
def test_used_with_package_scope (testdir : Any ) -> None :
1007
- """..."""
1035
+ testdir .makeini (
1036
+ """
1037
+ [pytest]
1038
+ asyncio_mode=auto
1039
+ """
1040
+ )
1008
1041
testdir .makepyfile (
1009
1042
"""
1010
1043
import pytest
@@ -1027,7 +1060,12 @@ def test_get_random_number():
1027
1060
1028
1061
1029
1062
def test_used_with_session_scope (testdir : Any ) -> None :
1030
- """..."""
1063
+ testdir .makeini (
1064
+ """
1065
+ [pytest]
1066
+ asyncio_mode=auto
1067
+ """
1068
+ )
1031
1069
testdir .makepyfile (
1032
1070
"""
1033
1071
import pytest
0 commit comments