---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
  --> PT023.py:51:1
   |
51 | @pytest.mark.foo()
   | ^^^^^^^^^^^^^^^^^^
52 | def test_something():
53 |     pass
   |
help: Remove parentheses
   |
50 |
   - @pytest.mark.foo()
51 + @pytest.mark.foo
52 | def test_something():
   |

PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
  --> PT023.py:56:1
   |
56 | @pytest.mark.foo()
   | ^^^^^^^^^^^^^^^^^^
57 | class TestClass:
58 |     def test_something():
   |
help: Remove parentheses
   |
55 |
   - @pytest.mark.foo()
56 + @pytest.mark.foo
57 | class TestClass:
   |

PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
  --> PT023.py:63:5
   |
62 | class TestClass:
63 |     @pytest.mark.foo()
   |     ^^^^^^^^^^^^^^^^^^
64 |     def test_something():
65 |         pass
   |
help: Remove parentheses
   |
62 | class TestClass:
   -     @pytest.mark.foo()
63 +     @pytest.mark.foo
64 |     def test_something():
   |

PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
  --> PT023.py:69:5
   |
68 | class TestClass:
69 |     @pytest.mark.foo()
   |     ^^^^^^^^^^^^^^^^^^
70 |     class TestNestedClass:
71 |         def test_something():
   |
help: Remove parentheses
   |
68 | class TestClass:
   -     @pytest.mark.foo()
69 +     @pytest.mark.foo
70 |     class TestNestedClass:
   |

PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
  --> PT023.py:77:9
   |
75 | class TestClass:
76 |     class TestNestedClass:
77 |         @pytest.mark.foo()
   |         ^^^^^^^^^^^^^^^^^^
78 |         def test_something():
79 |             pass
   |
help: Remove parentheses
   |
76 |     class TestNestedClass:
   -         @pytest.mark.foo()
77 +         @pytest.mark.foo
78 |         def test_something():
   |

PT023 [*] Use `@pytest.mark.parametrize` over `@pytest.mark.parametrize()`
  --> PT023.py:82:1
   |
81 |   # https://github.com/astral-sh/ruff/issues/18770
82 | / @pytest.mark.parametrize(
83 | |     # TODO: fix later
84 | |     # ("param1", "param2"),
85 | |     # (
86 | |     #     (1, 2),
87 | |     #     (3, 4),
88 | |     # ),
89 | | )
   | |_^
90 |   def test_bar(param1, param2): ...
   |
help: Remove parentheses
   |
81 | # https://github.com/astral-sh/ruff/issues/18770
   - @pytest.mark.parametrize(
   -     # TODO: fix later
   -     # ("param1", "param2"),
   -     # (
   -     #     (1, 2),
   -     #     (3, 4),
   -     # ),
   - )
82 + @pytest.mark.parametrize
83 | def test_bar(param1, param2): ...
   |
note: This is an unsafe fix and may change runtime behavior

PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
  --> PT023.py:93:1
   |
93 | @(pytest.mark.foo())
   | ^^^^^^^^^^^^^^^^^^^^
94 | def test_outer_paren_mark_function():
95 |     pass
   |
help: Remove parentheses
   |
92 |
   - @(pytest.mark.foo())
93 + @(pytest.mark.foo)
94 | def test_outer_paren_mark_function():
   |

PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()`
   --> PT023.py:99:5
    |
 98 | class TestClass:
 99 |     @(pytest.mark.foo())
    |     ^^^^^^^^^^^^^^^^^^^^
100 |     def test_method_outer_paren():
101 |         pass
    |
help: Remove parentheses
    |
98  | class TestClass:
    -     @(pytest.mark.foo())
99  +     @(pytest.mark.foo)
100 |     def test_method_outer_paren():
    |
