Summary
Pytest has different semantics for single argnames when using a string or a tuple/list.
With a tuple/list, it expects a one-element sequence as each argvalue, so this is valid:
@pytest.mark.parametrize(("number",), [(0,)])
However, with a string, it just expects a list of the argvalues, so this is valid:
@pytest.mark.parametrize("number", [0])
Rule PT006 updates the first case to look like this:
@pytest.mark.parametrize("number", [(0,)])
which now means that "number" is passed as a tuple and probably breaks the test.
I think the best way to fix this is to flag the error and not fix it when there is one argument.
Version
ruff 0.15.11
Summary
Pytest has different semantics for single argnames when using a string or a tuple/list.
With a tuple/list, it expects a one-element sequence as each argvalue, so this is valid:
@pytest.mark.parametrize(("number",), [(0,)])However, with a string, it just expects a list of the argvalues, so this is valid:
@pytest.mark.parametrize("number", [0])Rule PT006 updates the first case to look like this:
@pytest.mark.parametrize("number", [(0,)])which now means that "number" is passed as a tuple and probably breaks the test.
I think the best way to fix this is to flag the error and not fix it when there is one argument.
Version
ruff 0.15.11