-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations
Description
Minified example tests/test_ruff_bug.py:
import pytest
@pytest.mark.parametrize(
["whatever"],
[
((),),
((1,),),
],
)
def test_pt006_fix_error(whatever):
assert 1 + 2 > sum(whatever)Output:
error: Fix introduced a syntax error. Reverting all changes.
This indicates a bug in Ruff. If you could open an issue at:
https://github.com/astral-sh/ruff/issues/new?title=%5BFix%20error%5D
...quoting the contents of `tests/test_ruff_bug.py`, the rule codes PT006, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!
PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `str`
--> tests/test_ruff_bug.py:5:5
|
4 | @pytest.mark.parametrize(
5 | ["whatever"],
| ^^^^^^^^^^^^
6 | [
7 | ((),),
|
help: Use a string for the first argument
pyproject.toml:
[tool.ruff.lint]
select = ["PT006"]
Executed command: ruff check --fix tests/test_ruff_bug.py
If you remove any item in parametrization list, either ((),) or ((1,),), the fix succeeds.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations