File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ def _preprocess_async_fixtures(
239239 func
240240 ):
241241 continue
242- if not _is_asyncio_fixture_function ( func ) and asyncio_mode == Mode .STRICT :
242+ if asyncio_mode == Mode .STRICT and not _is_asyncio_fixture_function ( func ) :
243243 # Ignore async fixtures without explicit asyncio mark in strict mode
244244 # This applies to pytest_trio fixtures, for example
245245 continue
@@ -969,9 +969,9 @@ def pytest_pyfunc_call(pyfuncitem: Function) -> object | None:
969969 # fixturedefs. The last entry in the list is closest and the one used.
970970 func = fixtures [- 1 ].func
971971 if (
972- _is_coroutine_or_asyncgen (func )
972+ asyncio_mode == Mode .STRICT
973+ and _is_coroutine_or_asyncgen (func )
973974 and not _is_asyncio_fixture_function (func )
974- and asyncio_mode == Mode .STRICT
975975 ):
976976 warnings .warn (
977977 PytestDeprecationWarning (
You can’t perform that action at this time.
0 commit comments