From b150b192d42df60035868faeb0c052c7e375a99e Mon Sep 17 00:00:00 2001 From: ketpatil77 Date: Mon, 19 Oct 2026 16:13:07 +0530 Subject: [PATCH] fix: validate marker loop_scope values --- pytest_asyncio/plugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 38b75e41..e99a8d03 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -979,8 +979,7 @@ def _parse_asyncio_marker( scope = asyncio_marker.kwargs.get("loop_scope") or asyncio_marker.kwargs.get( "scope" ) - if scope is not None: - assert scope in {"function", "class", "module", "package", "session"} + _validate_scope(scope, "loop_scope") marker_value = asyncio_marker.kwargs.get("loop_factories") if marker_value is None: return scope, None