From 3a4bf3767b28e81f0edd974f5b53c5c38175d63e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 28 Jun 2026 23:49:22 +0100 Subject: [PATCH] Don't define class-scoped fixtures as instance methods This is deprecated as of pytest 9.1; see https://docs.pytest.org/en/stable/deprecations.html#class-scoped-fixture-as-instance-method. --- tests/opc/test_phys_pkg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/opc/test_phys_pkg.py b/tests/opc/test_phys_pkg.py index 6de0d868b..c4fef38f2 100644 --- a/tests/opc/test_phys_pkg.py +++ b/tests/opc/test_phys_pkg.py @@ -59,7 +59,8 @@ def pkg_file_(self, request): return loose_mock(request) @pytest.fixture(scope="class") - def dir_reader(self): + @classmethod + def dir_reader(cls): return _DirPkgReader(dir_pkg_path) @@ -115,7 +116,8 @@ def it_returns_none_when_part_has_no_rels_xml(self, phys_reader): # fixtures --------------------------------------------- @pytest.fixture(scope="class") - def phys_reader(self): + @classmethod + def phys_reader(cls): phys_reader = _ZipPkgReader(zip_pkg_path) yield phys_reader phys_reader.close()