---
source: crates/ruff/src/rules/flake8_pytest_style/mod.rs
---
PT023.py:12:2: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo`
   |
12 | @pytest.mark.foo
   |  ^^^^^^^^^^^^^^^ PT023
13 | def test_something():
14 |     pass
   |
   = help: Add/remove parentheses

ℹ Suggested fix
9  9  | # Without parentheses
10 10 | 
11 11 | 
12    |-@pytest.mark.foo
   12 |+@pytest.mark.foo()
13 13 | def test_something():
14 14 |     pass
15 15 | 

PT023.py:17:2: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo`
   |
17 | @pytest.mark.foo
   |  ^^^^^^^^^^^^^^^ PT023
18 | class TestClass:
19 |     def test_something():
   |
   = help: Add/remove parentheses

ℹ Suggested fix
14 14 |     pass
15 15 | 
16 16 | 
17    |-@pytest.mark.foo
   17 |+@pytest.mark.foo()
18 18 | class TestClass:
19 19 |     def test_something():
20 20 |         pass

PT023.py:24:6: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo`
   |
24 | class TestClass:
25 |     @pytest.mark.foo
   |      ^^^^^^^^^^^^^^^ PT023
26 |     def test_something():
27 |         pass
   |
   = help: Add/remove parentheses

ℹ Suggested fix
21 21 | 
22 22 | 
23 23 | class TestClass:
24    |-    @pytest.mark.foo
   24 |+    @pytest.mark.foo()
25 25 |     def test_something():
26 26 |         pass
27 27 | 

PT023.py:30:6: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo`
   |
30 | class TestClass:
31 |     @pytest.mark.foo
   |      ^^^^^^^^^^^^^^^ PT023
32 |     class TestNestedClass:
33 |         def test_something():
   |
   = help: Add/remove parentheses

ℹ Suggested fix
27 27 | 
28 28 | 
29 29 | class TestClass:
30    |-    @pytest.mark.foo
   30 |+    @pytest.mark.foo()
31 31 |     class TestNestedClass:
32 32 |         def test_something():
33 33 |             pass

PT023.py:38:10: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo`
   |
38 | class TestClass:
39 |     class TestNestedClass:
40 |         @pytest.mark.foo
   |          ^^^^^^^^^^^^^^^ PT023
41 |         def test_something():
42 |             pass
   |
   = help: Add/remove parentheses

ℹ Suggested fix
35 35 | 
36 36 | class TestClass:
37 37 |     class TestNestedClass:
38    |-        @pytest.mark.foo
   38 |+        @pytest.mark.foo()
39 39 |         def test_something():
40 40 |             pass
41 41 | 


