---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT028.py:3:16: PT028 Test function parameter `a` has default argument
  |
1 | # Errors
2 |
3 | def test_foo(a=1): ...
  |                ^ PT028
4 | def test_foo(a = 1): ...
5 | def test_foo(a = (1)): ...
  |
  = help: Remove default argument

ℹ Display-only fix
1 1 | # Errors
2 2 | 
3   |-def test_foo(a=1): ...
  3 |+def test_foo(a): ...
4 4 | def test_foo(a = 1): ...
5 5 | def test_foo(a = (1)): ...
6 6 | def test_foo(a: int=1): ...

PT028.py:4:18: PT028 Test function parameter `a` has default argument
  |
3 | def test_foo(a=1): ...
4 | def test_foo(a = 1): ...
  |                  ^ PT028
5 | def test_foo(a = (1)): ...
6 | def test_foo(a: int=1): ...
  |
  = help: Remove default argument

ℹ Display-only fix
1 1 | # Errors
2 2 | 
3 3 | def test_foo(a=1): ...
4   |-def test_foo(a = 1): ...
  4 |+def test_foo(a): ...
5 5 | def test_foo(a = (1)): ...
6 6 | def test_foo(a: int=1): ...
7 7 | def test_foo(a: int = 1): ...

PT028.py:5:19: PT028 Test function parameter `a` has default argument
  |
3 | def test_foo(a=1): ...
4 | def test_foo(a = 1): ...
5 | def test_foo(a = (1)): ...
  |                   ^ PT028
6 | def test_foo(a: int=1): ...
7 | def test_foo(a: int = 1): ...
  |
  = help: Remove default argument

ℹ Display-only fix
2 2 | 
3 3 | def test_foo(a=1): ...
4 4 | def test_foo(a = 1): ...
5   |-def test_foo(a = (1)): ...
  5 |+def test_foo(a): ...
6 6 | def test_foo(a: int=1): ...
7 7 | def test_foo(a: int = 1): ...
8 8 | def test_foo(a: (int) = 1): ...

PT028.py:6:21: PT028 Test function parameter `a` has default argument
  |
4 | def test_foo(a = 1): ...
5 | def test_foo(a = (1)): ...
6 | def test_foo(a: int=1): ...
  |                     ^ PT028
7 | def test_foo(a: int = 1): ...
8 | def test_foo(a: (int) = 1): ...
  |
  = help: Remove default argument

ℹ Display-only fix
3 3 | def test_foo(a=1): ...
4 4 | def test_foo(a = 1): ...
5 5 | def test_foo(a = (1)): ...
6   |-def test_foo(a: int=1): ...
  6 |+def test_foo(a: int): ...
7 7 | def test_foo(a: int = 1): ...
8 8 | def test_foo(a: (int) = 1): ...
9 9 | def test_foo(a: int = (1)): ...

PT028.py:7:23: PT028 Test function parameter `a` has default argument
  |
5 | def test_foo(a = (1)): ...
6 | def test_foo(a: int=1): ...
7 | def test_foo(a: int = 1): ...
  |                       ^ PT028
8 | def test_foo(a: (int) = 1): ...
9 | def test_foo(a: int = (1)): ...
  |
  = help: Remove default argument

ℹ Display-only fix
4 4 | def test_foo(a = 1): ...
5 5 | def test_foo(a = (1)): ...
6 6 | def test_foo(a: int=1): ...
7   |-def test_foo(a: int = 1): ...
  7 |+def test_foo(a: int): ...
8 8 | def test_foo(a: (int) = 1): ...
9 9 | def test_foo(a: int = (1)): ...
10 10 | def test_foo(a: (int) = (1)): ...

PT028.py:8:25: PT028 Test function parameter `a` has default argument
   |
 6 | def test_foo(a: int=1): ...
 7 | def test_foo(a: int = 1): ...
 8 | def test_foo(a: (int) = 1): ...
   |                         ^ PT028
 9 | def test_foo(a: int = (1)): ...
10 | def test_foo(a: (int) = (1)): ...
   |
   = help: Remove default argument

ℹ Display-only fix
5 5 | def test_foo(a = (1)): ...
6 6 | def test_foo(a: int=1): ...
7 7 | def test_foo(a: int = 1): ...
8   |-def test_foo(a: (int) = 1): ...
  8 |+def test_foo(a: (int)): ...
9 9 | def test_foo(a: int = (1)): ...
10 10 | def test_foo(a: (int) = (1)): ...
11 11 | def test_foo(a=1, /, b=2, *, c=3): ...

PT028.py:9:24: PT028 Test function parameter `a` has default argument
   |
 7 | def test_foo(a: int = 1): ...
 8 | def test_foo(a: (int) = 1): ...
 9 | def test_foo(a: int = (1)): ...
   |                        ^ PT028
10 | def test_foo(a: (int) = (1)): ...
11 | def test_foo(a=1, /, b=2, *, c=3): ...
   |
   = help: Remove default argument

ℹ Display-only fix
6  6  | def test_foo(a: int=1): ...
7  7  | def test_foo(a: int = 1): ...
8  8  | def test_foo(a: (int) = 1): ...
9     |-def test_foo(a: int = (1)): ...
   9  |+def test_foo(a: int): ...
10 10 | def test_foo(a: (int) = (1)): ...
11 11 | def test_foo(a=1, /, b=2, *, c=3): ...
12 12 | 

PT028.py:10:26: PT028 Test function parameter `a` has default argument
   |
 8 | def test_foo(a: (int) = 1): ...
 9 | def test_foo(a: int = (1)): ...
10 | def test_foo(a: (int) = (1)): ...
   |                          ^ PT028
11 | def test_foo(a=1, /, b=2, *, c=3): ...
   |
   = help: Remove default argument

ℹ Display-only fix
7  7  | def test_foo(a: int = 1): ...
8  8  | def test_foo(a: (int) = 1): ...
9  9  | def test_foo(a: int = (1)): ...
10    |-def test_foo(a: (int) = (1)): ...
   10 |+def test_foo(a: (int)): ...
11 11 | def test_foo(a=1, /, b=2, *, c=3): ...
12 12 | 
13 13 | 

PT028.py:11:16: PT028 Test function parameter `a` has default argument
   |
 9 | def test_foo(a: int = (1)): ...
10 | def test_foo(a: (int) = (1)): ...
11 | def test_foo(a=1, /, b=2, *, c=3): ...
   |                ^ PT028
   |
   = help: Remove default argument

ℹ Display-only fix
8  8  | def test_foo(a: (int) = 1): ...
9  9  | def test_foo(a: int = (1)): ...
10 10 | def test_foo(a: (int) = (1)): ...
11    |-def test_foo(a=1, /, b=2, *, c=3): ...
   11 |+def test_foo(a, /, b=2, *, c=3): ...
12 12 | 
13 13 | 
14 14 | # No errors

PT028.py:11:24: PT028 Test function parameter `b` has default argument
   |
 9 | def test_foo(a: int = (1)): ...
10 | def test_foo(a: (int) = (1)): ...
11 | def test_foo(a=1, /, b=2, *, c=3): ...
   |                        ^ PT028
   |
   = help: Remove default argument

ℹ Display-only fix
8  8  | def test_foo(a: (int) = 1): ...
9  9  | def test_foo(a: int = (1)): ...
10 10 | def test_foo(a: (int) = (1)): ...
11    |-def test_foo(a=1, /, b=2, *, c=3): ...
   11 |+def test_foo(a=1, /, b, *, c=3): ...
12 12 | 
13 13 | 
14 14 | # No errors

PT028.py:11:32: PT028 Test function parameter `c` has default argument
   |
 9 | def test_foo(a: int = (1)): ...
10 | def test_foo(a: (int) = (1)): ...
11 | def test_foo(a=1, /, b=2, *, c=3): ...
   |                                ^ PT028
   |
   = help: Remove default argument

ℹ Display-only fix
8  8  | def test_foo(a: (int) = 1): ...
9  9  | def test_foo(a: int = (1)): ...
10 10 | def test_foo(a: (int) = (1)): ...
11    |-def test_foo(a=1, /, b=2, *, c=3): ...
   11 |+def test_foo(a=1, /, b=2, *, c): ...
12 12 | 
13 13 | 
14 14 | # No errors
