ruff
aa765125 - [`flake8-pytest-style`] Avoid fixes for ambiguous `argnames` and `argvalues` combinations (`PT006`) (#24776)

Commit
56 days ago
[`flake8-pytest-style`] Avoid fixes for ambiguous `argnames` and `argvalues` combinations (`PT006`) (#24776) Fixes #24715 and related to #22441 ## Summary This prevents changes that break code (almost certainly) in rule [PT006](https://docs.astral.sh/ruff/rules/pytest-parametrize-names-wrong-type/#pytest-parametrize-names-wrong-type-pt006). Consider the following examples: ```python import pytest TEST_CASES = [...] @pytest.mark.parametrize(("number",), TEST_CASES) def foo(number): ... def generate_test_case(): ... @pytest.mark.parametrize(("number",), (generate_test_case(),)) def foo(number): ... single_test_case = ... @pytest.mark.parametrize(("number",), [single_test_case]) def foo(number): ... ``` Before this change, the `argnames` would 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. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
Author
Parents
Loading