You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a serious breakage; ruff --fix introduces an error.
The --fix option should also "fix" (i.e. de-tuple) the parameter value if it de-tuples the argnames parameter in case of a single parameter.
Apart from that, I find the obligatory (non-configurable) special case of tuple/list-less argnames in case of a single parameter quite questionable (if you later on would like to extend your test case with an additional parameter, you suddenly have to tuplify everything). I would prefer yet another configuration item that controls this quite opiniated preference for single parameter cases.
…mes` and `argvalues` if both of them are single-element tuples/lists (#14699)
## Summary
Close#11243. Fix `pytest-parametrize-names-wrong-type (PT006)` to edit
both `argnames` and `argvalues` if both of them are single-element
tuples/lists.
```python
# Before fix
@pytest.mark.parametrize(("x",), [(1,), (2,)])
def test_foo(x):
...
# After fix:
@pytest.mark.parametrize("x", [1, 2])
def test_foo(x):
...
```
## Test Plan
New test cases
PT006 breaks test, removes tuple just from argnames but not from argvalues
is replaced as
so now thresholds contains tuple of list. Shouldn't the fix remove also the brackets inside so the result would be:
command:
ruff tests/test.py --fix
ruff 0.4.2, no special settings needed, python 3.9
The text was updated successfully, but these errors were encountered: