pytest.fixture is given its scope as a positional string, which pytest 8 no longer accepts
What it finds
The options of pytest.fixture, such as scope, params and autouse, are keyword-only; @pytest.fixture("module") was deprecated and raises TypeError in current pytest. The first positional argument is reserved for the decorated function.
From the rule's source, fixture_positional_options.rs.
import pytest @pytest.fixture("module")tx0 reports: fixture options are keyword-onlydef db(): return 1 @pytest.fixture(scope="module")def other(): return 1 Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/python:fixture-positional-options" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:fixture-positional-options] reason="..."tx0 explain tx0/python:fixture-positional-options shows the same in the terminal. Found a false positive? Report it.