-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
211 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 134 additions & 9 deletions
143
...c/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT014.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,169 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | ||
--- | ||
PT014.py:4:35: PT014 Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
PT014.py:4:35: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
4 | @pytest.mark.parametrize("x", [1, 1, 2]) | ||
| ^ PT014 | ||
5 | def test_error_literal(x): | ||
6 | ... | ||
| | ||
= help: Remove duplicate test case | ||
|
||
PT014.py:14:35: PT014 Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
ℹ Suggested fix | ||
1 1 | import pytest | ||
2 2 | | ||
3 3 | | ||
4 |-@pytest.mark.parametrize("x", [1, 1, 2]) | ||
4 |+@pytest.mark.parametrize("x", [1, 2]) | ||
5 5 | def test_error_literal(x): | ||
6 6 | ... | ||
7 7 | | ||
|
||
PT014.py:14:35: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
14 | @pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ||
| ^ PT014 | ||
15 | def test_error_expr_simple(x): | ||
16 | ... | ||
| | ||
= help: Remove duplicate test case | ||
|
||
ℹ Suggested fix | ||
11 11 | c = 3 | ||
12 12 | | ||
13 13 | | ||
14 |-@pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ||
14 |+@pytest.mark.parametrize("x", [a, b, b, b, c]) | ||
15 15 | def test_error_expr_simple(x): | ||
16 16 | ... | ||
17 17 | | ||
|
||
PT014.py:14:41: PT014 Duplicate of test case at index 2 in `@pytest_mark.parametrize` | ||
PT014.py:14:41: PT014 [*] Duplicate of test case at index 2 in `@pytest_mark.parametrize` | ||
| | ||
14 | @pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ||
| ^ PT014 | ||
15 | def test_error_expr_simple(x): | ||
16 | ... | ||
| | ||
= help: Remove duplicate test case | ||
|
||
ℹ Suggested fix | ||
11 11 | c = 3 | ||
12 12 | | ||
13 13 | | ||
14 |-@pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ||
14 |+@pytest.mark.parametrize("x", [a, a, b, b, c]) | ||
15 15 | def test_error_expr_simple(x): | ||
16 16 | ... | ||
17 17 | | ||
|
||
PT014.py:14:44: PT014 Duplicate of test case at index 2 in `@pytest_mark.parametrize` | ||
PT014.py:14:44: PT014 [*] Duplicate of test case at index 2 in `@pytest_mark.parametrize` | ||
| | ||
14 | @pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ||
| ^ PT014 | ||
15 | def test_error_expr_simple(x): | ||
16 | ... | ||
| | ||
= help: Remove duplicate test case | ||
|
||
ℹ Suggested fix | ||
11 11 | c = 3 | ||
12 12 | | ||
13 13 | | ||
14 |-@pytest.mark.parametrize("x", [a, a, b, b, b, c]) | ||
14 |+@pytest.mark.parametrize("x", [a, a, b, b, c]) | ||
15 15 | def test_error_expr_simple(x): | ||
16 16 | ... | ||
17 17 | | ||
|
||
PT014.py:24:9: PT014 Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
22 | (a, b), | ||
23 | # comment | ||
24 | (a, b), | ||
| ^^^^^^ PT014 | ||
25 | (b, c), | ||
26 | ], | ||
| | ||
= help: Remove duplicate test case | ||
|
||
PT014.py:32:39: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
32 | @pytest.mark.parametrize("x", [a, b, (a), c, ((a))]) | ||
| ^ PT014 | ||
33 | def test_error_parentheses(x): | ||
34 | ... | ||
| | ||
= help: Remove duplicate test case | ||
|
||
PT014.py:19:40: PT014 Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
ℹ Suggested fix | ||
29 29 | ... | ||
30 30 | | ||
31 31 | | ||
32 |-@pytest.mark.parametrize("x", [a, b, (a), c, ((a))]) | ||
32 |+@pytest.mark.parametrize("x", [a, b, c, ((a))]) | ||
33 33 | def test_error_parentheses(x): | ||
34 34 | ... | ||
35 35 | | ||
|
||
PT014.py:32:48: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
32 | @pytest.mark.parametrize("x", [a, b, (a), c, ((a))]) | ||
| ^ PT014 | ||
33 | def test_error_parentheses(x): | ||
34 | ... | ||
| | ||
= help: Remove duplicate test case | ||
|
||
ℹ Suggested fix | ||
29 29 | ... | ||
30 30 | | ||
31 31 | | ||
32 |-@pytest.mark.parametrize("x", [a, b, (a), c, ((a))]) | ||
32 |+@pytest.mark.parametrize("x", [a, b, (a), c]) | ||
33 33 | def test_error_parentheses(x): | ||
34 34 | ... | ||
35 35 | | ||
|
||
PT014.py:42:10: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
19 | @pytest.mark.parametrize("x", [(a, b), (a, b), (b, c)]) | ||
| ^^^^^^ PT014 | ||
20 | def test_error_expr_complex(x): | ||
21 | ... | ||
40 | a, | ||
41 | b, | ||
42 | (a), | ||
| ^ PT014 | ||
43 | c, | ||
44 | ((a)), | ||
| | ||
= help: Remove duplicate test case | ||
|
||
ℹ Suggested fix | ||
39 39 | [ | ||
40 40 | a, | ||
41 41 | b, | ||
42 |- (a), | ||
43 42 | c, | ||
44 43 | ((a)), | ||
45 44 | ], | ||
|
||
PT014.py:44:11: PT014 [*] Duplicate of test case at index 0 in `@pytest_mark.parametrize` | ||
| | ||
42 | (a), | ||
43 | c, | ||
44 | ((a)), | ||
| ^ PT014 | ||
45 | ], | ||
46 | ) | ||
| | ||
= help: Remove duplicate test case | ||
|
||
ℹ Suggested fix | ||
41 41 | b, | ||
42 42 | (a), | ||
43 43 | c, | ||
44 |- ((a)), | ||
45 44 | ], | ||
46 45 | ) | ||
47 46 | def test_error_parentheses_trailing_comma(x): | ||
|
||
|