@@ -238,8 +238,8 @@ def _preprocess_async_fixtures(
238
238
for fixtures in fixturemanager ._arg2fixturedefs .values ():
239
239
for fixturedef in fixtures :
240
240
func = fixturedef .func
241
- if not _is_coroutine_or_asyncgen ( func ) and not getattr (
242
- func , "_async_fixture" , False
241
+ if fixturedef in processed_fixturedefs or not _is_coroutine_or_asyncgen (
242
+ func
243
243
):
244
244
continue
245
245
if not _is_asyncio_fixture_function (func ) and asyncio_mode == Mode .STRICT :
@@ -254,17 +254,12 @@ def _preprocess_async_fixtures(
254
254
if scope == "function" :
255
255
event_loop_fixture_id : Optional [str ] = "event_loop"
256
256
else :
257
- try :
258
- event_loop_node = _retrieve_scope_root (collector , scope )
259
- except Exception :
260
- continue
257
+ event_loop_node = _retrieve_scope_root (collector , scope )
261
258
event_loop_fixture_id = event_loop_node .stash .get (
262
259
# Type ignored because of non-optimal mypy inference.
263
260
_event_loop_fixture_id , # type: ignore[arg-type]
264
261
None ,
265
262
)
266
- if (fixturedef , event_loop_fixture_id ) in processed_fixturedefs :
267
- continue
268
263
_make_asyncio_fixture_function (func , scope )
269
264
function_signature = inspect .signature (func )
270
265
if "event_loop" in function_signature .parameters :
@@ -286,7 +281,7 @@ def _preprocess_async_fixtures(
286
281
fixturedef .argnames += ("event_loop" ,)
287
282
_synchronize_async_fixture (fixturedef )
288
283
assert _is_asyncio_fixture_function (fixturedef .func )
289
- processed_fixturedefs .add (( fixturedef , event_loop_fixture_id ) )
284
+ processed_fixturedefs .add (fixturedef )
290
285
291
286
292
287
def _synchronize_async_fixture (fixturedef : FixtureDef ) -> None :
0 commit comments