Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/7558.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix pylint ``not-callable`` lint on ``pytest.mark.parametrize()`` and the other builtin marks:
``skip``, ``skipif``, ``xfail``, ``usefixtures``, ``filterwarnings``.
14 changes: 6 additions & 8 deletions src/_pytest/mark/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import warnings
from typing import Any
from typing import Callable
from typing import cast
from typing import Iterable
from typing import List
from typing import Mapping
Expand Down Expand Up @@ -473,14 +472,13 @@ def test_function():

# See TYPE_CHECKING above.
if TYPE_CHECKING:
# Using casts instead of type comments intentionally - issue #7473.
# TODO(py36): Change to builtin annotation syntax.
skip = cast(_SkipMarkDecorator, None)
skipif = cast(_SkipifMarkDecorator, None)
xfail = cast(_XfailMarkDecorator, None)
parametrize = cast(_ParametrizeMarkDecorator, None)
usefixtures = cast(_UsefixturesMarkDecorator, None)
filterwarnings = cast(_FilterwarningsMarkDecorator, None)
skip = _SkipMarkDecorator(Mark("skip", (), {}))
skipif = _SkipifMarkDecorator(Mark("skipif", (), {}))
xfail = _XfailMarkDecorator(Mark("xfail", (), {}))
parametrize = _ParametrizeMarkDecorator(Mark("parametrize ", (), {}))
usefixtures = _UsefixturesMarkDecorator(Mark("usefixtures ", (), {}))
filterwarnings = _FilterwarningsMarkDecorator(Mark("filterwarnings ", (), {}))
Comment on lines +479 to +481
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason these have an extra space? and skip/skipif/xfail do not?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, just a bad vim macro...


def __getattr__(self, name: str) -> MarkDecorator:
if name[0] == "_":
Expand Down