[flake8-pytest-style] Avoid fixes for ambiguous argnames and argvalues combinations (PT006)#24776
Conversation
Do not adjust argnames when argvalues is not a sequence of tuples
|
Thanks for opening this, the changes aren't as involved as I feared. My main concern is that this decreases the usefulness of the rule if we're not offering a fix in more cases. I've approved the workflows so that we can get an ecosystem report and try to get some data on whether this removes more problems than it avoids desirable fixes. |
|
ntBre
left a comment
There was a problem hiding this comment.
Thanks! I tidied up some of the test changes, which reduced the size of the diff and made it easier to see the kinds of fixes that were removed. I think these were all cases where the fix was changing the behavior of the test and make sense not to offer a fix. I also moved the new test case into an mdtest.
flake8-pytest-style] Avoid fixes for ambiguous argnames and argvalues combinations (PT006)
Fixes #24715 and related to #22441
Summary
This prevents changes that break code (almost certainly) in rule PT006.
Consider the following examples:
Before this change, the
argnameswould be updated, which would probably break the test. After this change, no fix will be applied.Test Plan
I added one test, but mostly fixed existing tests.