-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Extend pytest-raises-with-multiple-statements (PT012)
to cover pytest.warns
#14239
Comments
pytest-raises-with-multiple-statements
to cover pytest.warns
pytest-raises-with-multiple-statements (PT012)
to cover pytest.warns
Adding a new rule is another option. |
I think that would have to be its own rule unless we rename the existing rule |
Makes sense. |
@MichaReiser do we need to add the same rule in https://github.com/m-burst/flake8-pytest-style to add it in ruff? |
I think it should be fine. We just need to make sure that we use a rule code that's unlikely to collide with any new rule added to the upstream plugin |
Created an issue in the upstream repo: m-burst/flake8-pytest-style#317 |
Thanks @tjkuson |
This lint makes a lot of sense to me. I'll make a draft branch. I'll just use a placeholder rule code until the flake8 plugin decides on one. There could also be |
I have a finished branch: https://github.com/snowdrop4/ruff/tree/AVK/PytestWarnsWithMultipleStatements But yeah, I'll wait and see what the flake8 plugin people say before PRing. |
The upstream issue has been closed as completed in case someone's interested to work on this |
I volunteer unless @snowdrop4 fancies it |
pytest-raises-with-multiple-statements
only coverspytest.raises
. It'd be nice if it coverspytest.warns
as well.Playground to ensure
pytest.warns
is not covered: https://play.ruff.rs/271e2f8e-751a-4368-971c-322eeeb10b39References:
The text was updated successfully, but these errors were encountered: