Skip to content

PT006 breaks test by removing tuple from parametrize #11243

@Pebin

Description

@Pebin

PT006 breaks test, removes tuple just from argnames but not from argvalues

@pytest.mark.parametrize(("thresholds",), [([0.6, 0.3],), ([],)])

is replaced as

@pytest.mark.parametrize("thresholds", [([0.6, 0.3],), ([],)])

so now thresholds contains tuple of list. Shouldn't the fix remove also the brackets inside so the result would be:

@pytest.mark.parametrize("thresholds", [[0.6, 0.3], []])

command:
ruff tests/test.py --fix

ruff 0.4.2, no special settings needed, python 3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions