Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PT006 breaks test by removing tuple from parametrize #11243

Open
Pebin opened this issue May 2, 2024 · 0 comments
Open

PT006 breaks test by removing tuple from parametrize #11243

Pebin opened this issue May 2, 2024 · 0 comments
Labels
bug Something isn't working fixes Related to suggested fixes for violations

Comments

@Pebin
Copy link

Pebin commented May 2, 2024

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

@charliermarsh charliermarsh added bug Something isn't working fixes Related to suggested fixes for violations labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations
Projects
None yet
Development

No branches or pull requests

2 participants