From e2f7cb66bda22f3790ac0990eb6b79e9b078a701 Mon Sep 17 00:00:00 2001 From: eladkal <45845474+eladkal@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:05:11 +0300 Subject: [PATCH] Fix pytest class-scoped fixture deprecation warning in extract_permissions tests pytest 9.1 deprecates defining a class-scoped fixture as a plain instance method, since attributes set on self in the fixture aren't visible to test methods (each test gets a new instance while the fixture runs once per class). test_extract_permissions.py had two such fixtures, all_entries and rst_content, triggering PytestRemovedIn10Warning on every run. Neither fixture actually relied on self, so marking them as @classmethod removes the warning with no behavior change. --- scripts/tests/ci/prek/test_extract_permissions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/tests/ci/prek/test_extract_permissions.py b/scripts/tests/ci/prek/test_extract_permissions.py index 40be37dff0d28..2900c66f603b1 100644 --- a/scripts/tests/ci/prek/test_extract_permissions.py +++ b/scripts/tests/ci/prek/test_extract_permissions.py @@ -627,7 +627,8 @@ class TestExtractAllPermissions: """ @pytest.fixture(scope="class") - def all_entries(self) -> list[PermissionEntry]: + @classmethod + def all_entries(cls) -> list[PermissionEntry]: return extract_all_permissions(PUBLIC_ROUTES_DIR) def test_extracts_non_empty_result(self, all_entries): @@ -769,7 +770,8 @@ def test_clear_dag_runs_endpoint_prefix(self, all_entries): class TestRenderRst: @pytest.fixture(scope="class") - def rst_content(self) -> str: + @classmethod + def rst_content(cls) -> str: entries = extract_all_permissions(PUBLIC_ROUTES_DIR) return render_rst(entries)