Skip to content

Conversation

@bluetech
Copy link
Member

This fixes #7473.

It seems that pylint doesn't understand TYPE_CHECKING and/or the type comments, and thinks parametrize and friends are None, and then complains that they are not callable.

The solution is a little uglier but seems to do the trick. On Python 3.6 we can use the nice syntax, which I also tested and will work.

parametrize = None # type: _ParametrizeMarkDecorator
usefixtures = None # type: _UsefixturesMarkDecorator
filterwarnings = None # type: _FilterwarningsMarkDecorator
skip = cast(_SkipMarkDecorator, None)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps leave a TODO note to use proper type annotations once we drop Python 3.5?

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually had it in my unsaved editor buffer 🤦 Pushed now.

@nicoddemus nicoddemus merged commit 0b58f73 into pytest-dev:master Jul 10, 2020
@bluetech bluetech deleted the pylint-callable branch July 14, 2020 07:17
sdimitro added a commit to sdimitro/sdb-dlpx that referenced this pull request Jul 29, 2020
Context:
Issue: pytest-dev/pytest#7473
PR that was just merged: pytest-dev/pytest#7476

Opened issue to get rid of this once `pytest` is updated:
delphix#235
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest 6: pylint shows not-callable error for builtin pytest marks

2 participants