Merge pull request #7566 from bluetech/pylint-callable-2-6.0.x

[6.0.x] mark: fix pylint not-callable error on pytest.mark.parametrize(...), again
This commit is contained in:
Ran Benita 2020-07-29 13:04:23 +03:00 committed by GitHub
commit d46fe88ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -0,0 +1,2 @@
Fix pylint ``not-callable`` lint on ``pytest.mark.parametrize()`` and the other builtin marks:
``skip``, ``skipif``, ``xfail``, ``usefixtures``, ``filterwarnings``.

View File

@ -4,7 +4,6 @@ import typing
import warnings import warnings
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import cast
from typing import Iterable from typing import Iterable
from typing import List from typing import List
from typing import Mapping from typing import Mapping
@ -473,14 +472,13 @@ class MarkGenerator:
# See TYPE_CHECKING above. # See TYPE_CHECKING above.
if TYPE_CHECKING: if TYPE_CHECKING:
# Using casts instead of type comments intentionally - issue #7473.
# TODO(py36): Change to builtin annotation syntax. # TODO(py36): Change to builtin annotation syntax.
skip = cast(_SkipMarkDecorator, None) skip = _SkipMarkDecorator(Mark("skip", (), {}))
skipif = cast(_SkipifMarkDecorator, None) skipif = _SkipifMarkDecorator(Mark("skipif", (), {}))
xfail = cast(_XfailMarkDecorator, None) xfail = _XfailMarkDecorator(Mark("xfail", (), {}))
parametrize = cast(_ParametrizeMarkDecorator, None) parametrize = _ParametrizeMarkDecorator(Mark("parametrize", (), {}))
usefixtures = cast(_UsefixturesMarkDecorator, None) usefixtures = _UsefixturesMarkDecorator(Mark("usefixtures", (), {}))
filterwarnings = cast(_FilterwarningsMarkDecorator, None) filterwarnings = _FilterwarningsMarkDecorator(Mark("filterwarnings", (), {}))
def __getattr__(self, name: str) -> MarkDecorator: def __getattr__(self, name: str) -> MarkDecorator:
if name[0] == "_": if name[0] == "_":