Skip to content
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

Unexepected "No name 'absltest' ..." lint error from pylint #134

Open
greed42 opened this issue Mar 17, 2020 · 1 comment
Open

Unexepected "No name 'absltest' ..." lint error from pylint #134

greed42 opened this issue Mar 17, 2020 · 1 comment

Comments

@greed42
Copy link

greed42 commented Mar 17, 2020

When linting an absltest-based test suite with pylint, I am now getting the following message:

************* Module lint_bug
lint_bug.py:8:0: E0611: No name 'absltest' in module 'absl.testing' (no-name-in-module)

This has only started as of absl-py==0.9.0, and requires the type declaration for TestCase.enter_context, # type: (ContextManager[_T]) -> _T, be present in absltest.py.

It looks a bit like this is actually a fault with pylint, but have not been able to create a standalone reproduction case at this point. The code -- both the reduced fragment below and my original test suite -- run correctly. (And pytest is happy with them as well.)

The source for lint_bug.py is:

"""Show an unexpected pylint error with absltest.

There is an unexpected no-name-in-module with absl-py==0.9.0.

pip3 install pylint==2.4.4 absl-py==0.9.0
python3 -m pylint lint_bug.py
"""
from absl.testing import absltest

if __name__ == '__main__':
    absltest.main()
@Cor-leone
Copy link

corleon995@gmail.com

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

No branches or pull requests

2 participants