Skip to content

Commit c1ca42b

Browse files
committed
mark/structure: fix pylint complaining that builtin marks are not callable
1 parent 2ae721c commit c1ca42b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/_pytest/mark/structures.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import warnings
55
from typing import Any
66
from typing import Callable
7+
from typing import cast
78
from typing import Iterable
89
from typing import List
910
from typing import Mapping
@@ -467,12 +468,14 @@ def test_function():
467468

468469
# See TYPE_CHECKING above.
469470
if TYPE_CHECKING:
470-
skip = None # type: _SkipMarkDecorator
471-
skipif = None # type: _SkipifMarkDecorator
472-
xfail = None # type: _XfailMarkDecorator
473-
parametrize = None # type: _ParametrizeMarkDecorator
474-
usefixtures = None # type: _UsefixturesMarkDecorator
475-
filterwarnings = None # type: _FilterwarningsMarkDecorator
471+
# Using casts instead of type comments intentionally - issue #7473.
472+
# TODO(py36): Change to builtin annotation syntax.
473+
skip = cast(_SkipMarkDecorator, None)
474+
skipif = cast(_SkipifMarkDecorator, None)
475+
xfail = cast(_XfailMarkDecorator, None)
476+
parametrize = cast(_ParametrizeMarkDecorator, None)
477+
usefixtures = cast(_UsefixturesMarkDecorator, None)
478+
filterwarnings = cast(_FilterwarningsMarkDecorator, None)
476479

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

0 commit comments

Comments
 (0)