Skip to content

mark/structure: fix pylint complaining that builtin marks are not callable #7476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2020

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