---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT006.py:24:26: PT006 [*] Wrong type passed to first argument of `@pytest.mark.parametrize`; expected a string of comma-separated values
   |
24 | @pytest.mark.parametrize(("param1", "param2"), [(1, 2), (3, 4)])
   |                          ^^^^^^^^^^^^^^^^^^^^ PT006
25 | def test_tuple(param1, param2):
26 |     ...
   |
   = help: Use a string of comma-separated values for the first argument

ℹ Unsafe fix
21 21 |     ...
22 22 | 
23 23 | 
24    |-@pytest.mark.parametrize(("param1", "param2"), [(1, 2), (3, 4)])
   24 |+@pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)])
25 25 | def test_tuple(param1, param2):
26 26 |     ...
27 27 | 

PT006.py:29:26: PT006 [*] Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `str`
   |
29 | @pytest.mark.parametrize(("param1",), [1, 2, 3])
   |                          ^^^^^^^^^^^ PT006
30 | def test_tuple_one_elem(param1, param2):
31 |     ...
   |
   = help: Use a string for the first argument

ℹ Safe fix
26 26 |     ...
27 27 | 
28 28 | 
29    |-@pytest.mark.parametrize(("param1",), [1, 2, 3])
   29 |+@pytest.mark.parametrize("param1", [1, 2, 3])
30 30 | def test_tuple_one_elem(param1, param2):
31 31 |     ...
32 32 | 

PT006.py:34:26: PT006 [*] Wrong type passed to first argument of `@pytest.mark.parametrize`; expected a string of comma-separated values
   |
34 | @pytest.mark.parametrize(["param1", "param2"], [(1, 2), (3, 4)])
   |                          ^^^^^^^^^^^^^^^^^^^^ PT006
35 | def test_list(param1, param2):
36 |     ...
   |
   = help: Use a string of comma-separated values for the first argument

ℹ Unsafe fix
31 31 |     ...
32 32 | 
33 33 | 
34    |-@pytest.mark.parametrize(["param1", "param2"], [(1, 2), (3, 4)])
   34 |+@pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)])
35 35 | def test_list(param1, param2):
36 36 |     ...
37 37 | 

PT006.py:39:26: PT006 [*] Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `str`
   |
39 | @pytest.mark.parametrize(["param1"], [1, 2, 3])
   |                          ^^^^^^^^^^ PT006
40 | def test_list_one_elem(param1, param2):
41 |     ...
   |
   = help: Use a string for the first argument

ℹ Safe fix
36 36 |     ...
37 37 | 
38 38 | 
39    |-@pytest.mark.parametrize(["param1"], [1, 2, 3])
   39 |+@pytest.mark.parametrize("param1", [1, 2, 3])
40 40 | def test_list_one_elem(param1, param2):
41 41 |     ...
42 42 | 

PT006.py:44:26: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected a string of comma-separated values
   |
44 | @pytest.mark.parametrize([some_expr, another_expr], [1, 2, 3])
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^ PT006
45 | def test_list_expressions(param1, param2):
46 |     ...
   |
   = help: Use a string of comma-separated values for the first argument

PT006.py:49:26: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected a string of comma-separated values
   |
49 | @pytest.mark.parametrize([some_expr, "param2"], [1, 2, 3])
   |                          ^^^^^^^^^^^^^^^^^^^^^ PT006
50 | def test_list_mixed_expr_literal(param1, param2):
51 |     ...
   |
   = help: Use a string of comma-separated values for the first argument
