Fix PT007 (use lists in `pytest.mark.parametrize`)

This commit is contained in:
Adam Turner
2023-07-28 07:03:53 +01:00
parent 02e011e4ff
commit fb5b80c340
3 changed files with 3 additions and 4 deletions

View File

@@ -223,7 +223,6 @@ ignore = [
"PLW2901", # outer loop variable overwritten by inner assignment
# flake8-pytest-style
"PT003", # `scope='function'` is implied in `@pytest.fixture()`
"PT007", # wrong values type in `@pytest.mark.parametrize`
"PT011", # `pytest.raises(ValueError)` is too broad, set the `match` parameter
# flake8-use-pathlib
"PTH",

View File

@@ -1453,7 +1453,7 @@ def test_warn_missing_reference(app, status, warning):
@pytest.mark.sphinx(confoverrides={'nitpicky': True})
@pytest.mark.parametrize('include_options', (True, False))
@pytest.mark.parametrize('include_options', [True, False])
def test_signature_line_number(app, include_options):
text = (".. py:function:: foo(bar : string)\n" +
(" :no-index-entry:\n" if include_options else ""))

View File

@@ -2592,11 +2592,11 @@ definition_after_normal_text : int
@pytest.mark.parametrize(
("name", "expected"),
(
[
("x, y, z", "x, y, z"),
("*args, **kwargs", r"\*args, \*\*kwargs"),
("*x, **y", r"\*x, \*\*y"),
),
],
)
def test_escape_args_and_kwargs(self, name, expected):
numpy_docstring = NumpyDocstring("")