|
1 | 1 | ---
|
2 | 2 | source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
|
3 | 3 | ---
|
4 |
| -PT001.py:9:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` |
| 4 | +PT001.py:14:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` |
5 | 5 | |
|
6 |
| - 9 | @pytest.fixture |
7 |
| - | ^^^^^^^^^^^^^^^ PT001 |
8 |
| -10 | def no_parentheses(): |
9 |
| -11 | return 42 |
| 6 | +14 | @pytest.fixture() |
| 7 | + | ^^^^^^^^^^^^^^^^^ PT001 |
| 8 | +15 | def parentheses_no_params(): |
| 9 | +16 | return 42 |
10 | 10 | |
|
11 |
| - = help: Add parentheses |
| 11 | + = help: Remove parentheses |
12 | 12 |
|
13 | 13 | ℹ Safe fix
|
14 |
| -6 6 | # `import pytest` |
15 |
| -7 7 | |
16 |
| -8 8 | |
17 |
| -9 |-@pytest.fixture |
18 |
| - 9 |+@pytest.fixture() |
19 |
| -10 10 | def no_parentheses(): |
20 | 14 | 11 11 | return 42
|
21 | 15 | 12 12 |
|
| 16 | +13 13 | |
| 17 | +14 |-@pytest.fixture() |
| 18 | + 14 |+@pytest.fixture |
| 19 | +15 15 | def parentheses_no_params(): |
| 20 | +16 16 | return 42 |
| 21 | +17 17 | |
22 | 22 |
|
23 |
| -PT001.py:34:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` |
| 23 | +PT001.py:24:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` |
24 | 24 | |
|
25 |
| -34 | @fixture |
26 |
| - | ^^^^^^^^ PT001 |
27 |
| -35 | def imported_from_no_parentheses(): |
28 |
| -36 | return 42 |
| 25 | +24 | / @pytest.fixture( |
| 26 | +25 | | |
| 27 | +26 | | ) |
| 28 | + | |_^ PT001 |
| 29 | +27 | def parentheses_no_params_multiline(): |
| 30 | +28 | return 42 |
29 | 31 | |
|
30 |
| - = help: Add parentheses |
| 32 | + = help: Remove parentheses |
| 33 | + |
| 34 | +ℹ Safe fix |
| 35 | +21 21 | return 42 |
| 36 | +22 22 | |
| 37 | +23 23 | |
| 38 | +24 |-@pytest.fixture( |
| 39 | +25 |- |
| 40 | +26 |-) |
| 41 | + 24 |+@pytest.fixture |
| 42 | +27 25 | def parentheses_no_params_multiline(): |
| 43 | +28 26 | return 42 |
| 44 | +29 27 | |
| 45 | + |
| 46 | +PT001.py:39:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` |
| 47 | + | |
| 48 | +39 | @fixture() |
| 49 | + | ^^^^^^^^^^ PT001 |
| 50 | +40 | def imported_from_parentheses_no_params(): |
| 51 | +41 | return 42 |
| 52 | + | |
| 53 | + = help: Remove parentheses |
31 | 54 |
|
32 | 55 | ℹ Safe fix
|
33 |
| -31 31 | # `from pytest import fixture` |
34 |
| -32 32 | |
35 |
| -33 33 | |
36 |
| -34 |-@fixture |
37 |
| - 34 |+@fixture() |
38 |
| -35 35 | def imported_from_no_parentheses(): |
39 | 56 | 36 36 | return 42
|
40 | 57 | 37 37 |
|
| 58 | +38 38 | |
| 59 | +39 |-@fixture() |
| 60 | + 39 |+@fixture |
| 61 | +40 40 | def imported_from_parentheses_no_params(): |
| 62 | +41 41 | return 42 |
| 63 | +42 42 | |
41 | 64 |
|
42 |
| -PT001.py:59:1: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` |
| 65 | +PT001.py:49:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` |
43 | 66 | |
|
44 |
| -59 | @aliased |
45 |
| - | ^^^^^^^^ PT001 |
46 |
| -60 | def aliased_no_parentheses(): |
47 |
| -61 | return 42 |
| 67 | +49 | / @fixture( |
| 68 | +50 | | |
| 69 | +51 | | ) |
| 70 | + | |_^ PT001 |
| 71 | +52 | def imported_from_parentheses_no_params_multiline(): |
| 72 | +53 | return 42 |
48 | 73 | |
|
49 |
| - = help: Add parentheses |
| 74 | + = help: Remove parentheses |
| 75 | + |
| 76 | +ℹ Safe fix |
| 77 | +46 46 | return 42 |
| 78 | +47 47 | |
| 79 | +48 48 | |
| 80 | +49 |-@fixture( |
| 81 | +50 |- |
| 82 | +51 |-) |
| 83 | + 49 |+@fixture |
| 84 | +52 50 | def imported_from_parentheses_no_params_multiline(): |
| 85 | +53 51 | return 42 |
| 86 | +54 52 | |
| 87 | + |
| 88 | +PT001.py:64:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` |
| 89 | + | |
| 90 | +64 | @aliased() |
| 91 | + | ^^^^^^^^^^ PT001 |
| 92 | +65 | def aliased_parentheses_no_params(): |
| 93 | +66 | return 42 |
| 94 | + | |
| 95 | + = help: Remove parentheses |
50 | 96 |
|
51 | 97 | ℹ Safe fix
|
52 |
| -56 56 | # `from pytest import fixture as aliased` |
53 |
| -57 57 | |
54 |
| -58 58 | |
55 |
| -59 |-@aliased |
56 |
| - 59 |+@aliased() |
57 |
| -60 60 | def aliased_no_parentheses(): |
58 | 98 | 61 61 | return 42
|
59 | 99 | 62 62 |
|
| 100 | +63 63 | |
| 101 | +64 |-@aliased() |
| 102 | + 64 |+@aliased |
| 103 | +65 65 | def aliased_parentheses_no_params(): |
| 104 | +66 66 | return 42 |
| 105 | +67 67 | |
60 | 106 |
|
| 107 | +PT001.py:74:1: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` |
| 108 | + | |
| 109 | +74 | / @aliased( |
| 110 | +75 | | |
| 111 | +76 | | ) |
| 112 | + | |_^ PT001 |
| 113 | +77 | def aliased_parentheses_no_params_multiline(): |
| 114 | +78 | return 42 |
| 115 | + | |
| 116 | + = help: Remove parentheses |
61 | 117 |
|
| 118 | +ℹ Safe fix |
| 119 | +71 71 | return 42 |
| 120 | +72 72 | |
| 121 | +73 73 | |
| 122 | +74 |-@aliased( |
| 123 | +75 |- |
| 124 | +76 |-) |
| 125 | + 74 |+@aliased |
| 126 | +77 75 | def aliased_parentheses_no_params_multiline(): |
| 127 | +78 76 | return 42 |
0 commit comments