Skip to content

Commit a360066

Browse files
committed
fix: Inject event_loop argument to fixtures that run in function scope loops.
1 parent ee75d65 commit a360066

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pytest_asyncio/plugin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@ def _preprocess_async_fixtures(
281281
assert event_loop_fixture_id
282282
if "request" not in fixturedef.argnames:
283283
fixturedef.argnames += ("request",)
284+
if (
285+
event_loop_fixture_id == "event_loop"
286+
and "event_loop" not in fixturedef.argnames
287+
):
288+
fixturedef.argnames += ("event_loop",)
284289
_synchronize_async_fixture(
285290
fixturedef,
286291
event_loop_fixture_name,

0 commit comments

Comments
 (0)