-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature request: automatic fixing per certain rules #215
Comments
Hi James, Thanks for raising this. In the meantime, I would like to note two things. |
Also, as mentioned in pytest-dev/pytest#10709 (comment), the rules from flake8-pytest-style are available in Ruff with some autofixes, including |
@jamesbraza Ruff is capable of automating these fixes. However, it is worth noting that |
Hi @cclauss, As mentioned in my comment above and in the docs for PT001, it is configurable: you can change the flag in your flake8 config to invert the rule behavior. |
I thought pytest docs usage examples would be the default behavior and that deviations would require special settings. |
I think it would be a massive time saver if there was a tool to automatically apply some of the suggested fixes.
This could be simple for rules such as:
PT001
: turning@pytest.fixture
into@pytest.fixture()
PT006
: converting@pytest.mark.parametrize
'sargnames
into a tupleRationale
It would be useful for repos just starting out with
flake8-pytest-style
, as implementing the suggested fixes can be arduous (taking hours), especially when there's hundreds of test cases needing fixing.The text was updated successfully, but these errors were encountered: