Open harupy opened 2 weeks ago
Adding a new rule is another option.
I think that would have to be its own rule unless we rename the existing rule
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: https://github.com/m-burst/flake8-pytest-style/issues/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 pytest.warns
versions of PT010
and PT011
(not just PT012
), since they are all analagous.
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.
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: