Pytest Fixture decorator order¶
Reports classmethod and staticmethod decorators above pytest.fixture and offers to swap adjacent pairs.
This inspection applies only when the file's interpreter uses pytest 9.2 or later. Older interpreters and unresolved pytest versions do not receive these warnings. The feature can be toggled independently under Settings → BetterPy → Testing / Pytest → Fixture Inspections.
Place @pytest.fixture above @classmethod or @staticmethod so pytest sees the method descriptor in the supported order. The quick-fix swaps adjacent decorators and preserves their arguments and the function body. When another decorator lies between them, only the warning is shown so wrappers are not reordered.