A pytest fixture is given scope="function", which is already the default
What it finds
Fixtures are made anew for every test unless a wider scope is asked for; writing scope="function" repeats the default and makes readers look twice for a difference.
From the rule's source, default_fixture_scope.rs.
import pytest @pytest.fixture(scope="function")tx0 reports: is the default scope of a fixturedef db(): return 1 @pytest.fixture(scope="module")def cache(): return 2 Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:default-fixture-scope" = "note"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:default-fixture-scope] reason="..."tx0 explain tx0/python:default-fixture-scope shows the same in the terminal. Found a false positive? Report it.