File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,9 @@ def pytest_configure(config):
152152@hookimpl (trylast = True )
153153def pytest_pyfunc_call (pyfuncitem ):
154154 testfunction = pyfuncitem .obj
155- if iscoroutinefunction (testfunction ):
155+ if iscoroutinefunction (testfunction ) or (
156+ sys .version_info >= (3 , 6 ) and inspect .isasyncgenfunction (testfunction )
157+ ):
156158 msg = "async def functions are not natively supported and have been skipped.\n "
157159 msg += "You need to install a suitable plugin for your async framework, for example:\n "
158160 msg += " - pytest-asyncio\n "
Original file line number Diff line number Diff line change @@ -1227,11 +1227,11 @@ async def test_2():
12271227 [
12281228 "test_async.py::test_1" ,
12291229 "test_async.py::test_2" ,
1230- "*Coroutine functions are not natively supported*" ,
1230+ "*async def functions are not natively supported*" ,
12311231 "*2 skipped, 2 warnings in*" ,
12321232 ]
12331233 )
12341234 # ensure our warning message appears only once
12351235 assert (
1236- result .stdout .str ().count ("Coroutine functions are not natively supported" ) == 1
1236+ result .stdout .str ().count ("async def functions are not natively supported" ) == 1
12371237 )
You can’t perform that action at this time.
0 commit comments