---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list`
 --> PT007.py:4:35
  |
4 | @pytest.mark.parametrize("param", (1, 2))
  |                                   ^^^^^^
5 | def test_tuple(param):
6 |     ...
  |
help: Use `list` for parameter values
  |
3 |
  - @pytest.mark.parametrize("param", (1, 2))
4 + @pytest.mark.parametrize("param", [1, 2])
5 | def test_tuple(param):
  |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:11:5
   |
 9 |   @pytest.mark.parametrize(
10 |       ("param1", "param2"),
11 | /     (
12 | |         (1, 2),
13 | |         (3, 4),
14 | |     ),
   | |_____^
15 |   )
16 |   def test_tuple_of_tuples(param1, param2):
   |
help: Use `list` of `tuple` for parameter values
   |
10 |     ("param1", "param2"),
   -     (
11 +     [
12 |         (1, 2),
13 |         (3, 4),
   -     ),
14 +     ],
15 | )
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:22:5
   |
20 |   @pytest.mark.parametrize(
21 |       ("param1", "param2"),
22 | /     (
23 | |         [1, 2],
24 | |         [3, 4],
25 | |     ),
   | |_____^
26 |   )
27 |   def test_tuple_of_lists(param1, param2):
   |
help: Use `list` of `tuple` for parameter values
   |
21 |     ("param1", "param2"),
   -     (
22 +     [
23 |         [1, 2],
24 |         [3, 4],
   -     ),
25 +     ],
26 | )
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:23:9
   |
21 |     ("param1", "param2"),
22 |     (
23 |         [1, 2],
   |         ^^^^^^
24 |         [3, 4],
25 |     ),
   |
help: Use `list` of `tuple` for parameter values
   |
22 |     (
   -         [1, 2],
23 +         (1, 2),
24 |         [3, 4],
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:24:9
   |
22 |     (
23 |         [1, 2],
24 |         [3, 4],
   |         ^^^^^^
25 |     ),
26 | )
   |
help: Use `list` of `tuple` for parameter values
   |
23 |         [1, 2],
   -         [3, 4],
24 +         (3, 4),
25 |     ),
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:50:9
   |
48 |     ("param1", "param2"),
49 |     [
50 |         [1, 2],
   |         ^^^^^^
51 |         [3, 4],
52 |     ],
   |
help: Use `list` of `tuple` for parameter values
   |
49 |     [
   -         [1, 2],
50 +         (1, 2),
51 |         [3, 4],
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:51:9
   |
49 |     [
50 |         [1, 2],
51 |         [3, 4],
   |         ^^^^^^
52 |     ],
53 | )
   |
help: Use `list` of `tuple` for parameter values
   |
50 |         [1, 2],
   -         [3, 4],
51 +         (3, 4),
52 |     ],
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:61:9
   |
59 |     "param1,param2",
60 |     [
61 |         [1, 2],
   |         ^^^^^^
62 |         [3, 4],
63 |     ],
   |
help: Use `list` of `tuple` for parameter values
   |
60 |     [
   -         [1, 2],
61 +         (1, 2),
62 |         [3, 4],
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:62:9
   |
60 |     [
61 |         [1, 2],
62 |         [3, 4],
   |         ^^^^^^
63 |     ],
64 | )
   |
help: Use `list` of `tuple` for parameter values
   |
61 |         [1, 2],
   -         [3, 4],
62 +         (3, 4),
63 |     ],
   |
note: This is an unsafe fix and may change runtime behavior

PT007 [*] Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple`
  --> PT007.py:81:38
   |
80 | @pytest.mark.parametrize("a", [1, 2])
81 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6)))
   |                                      ^^^^^^^^^^^^^^^^
82 | @pytest.mark.parametrize("d", [3,])
83 | @pytest.mark.parametrize(
   |
help: Use `list` of `tuple` for parameter values
   |
80 | @pytest.mark.parametrize("a", [1, 2])
   - @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6)))
81 + @pytest.mark.parametrize(("b", "c"), [(3, 4), (5, 6)])
82 | @pytest.mark.parametrize("d", [3,])
   |
note: This is an unsafe fix and may change runtime behavior
