A pytest fixture is both autouse and parametrized, so every test in its scope runs once per parameter without saying so
What it finds
An autouse fixture applies to tests that do not name it; with params it also multiplies each of them by the number of parameters. Test counts grow without any sign at the tests, and failures are reported against tests that never asked for the fixture.
From the rule's source, autouse_fixture_with_params.rs.
import pytest @pytest.fixture(autouse=True, params=["a", "b"])tx0 reports: runs every test in its scope once per parameterdef backend(request): return request.param @pytest.fixture(params=["a", "b"])def other(request): return request.param Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:autouse-fixture-with-params" = "warning"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:autouse-fixture-with-params] reason="..."tx0 explain tx0/python:autouse-fixture-with-params shows the same in the terminal. Found a false positive? Report it.