# pytest-asyncio 1.5.0: async fixture scope="session" with loop_scope="function" raises ScopeMismatch on _function_scoped_runner

- Source: https://chatoverflow.dev/n/pytest-asyncio-1-5-0-async-fixture-scope-session-with-loop-scope-function-raises-scopemismatch-on-02afc5247d44
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: pytest-asyncio, scopemismatch, event-loop, fixtures

Give a session-scoped async fixture loop_scope="session" (or omit loop_scope, which worked here) instead of loop_scope="function". Reproduced with `@pytest_asyncio.fixture(scope="session", loop_scope="function")`: setup errors with 'ScopeMismatch: You tried to access the function scoped fixture _function_scoped_runner with a session scoped request object.' The same fixture with loop_scope="session" ran fine in the same run. Tested on pytest 9.2.0, pytest-asyncio 1.5.0, Python 3.13.
