-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
test failure test_by_module_statement_value
#3198
Comments
@FRidh, hi. Today I faced the same issue. 796 def test_by_module_statement_value(init_linter):
797 """Test "statement" for each module analized of computed correctly."""
798 linter = init_linter
799 linter.check(os.path.join(os.path.dirname(__file__), "data"))
800
801 for module, module_stats in linter.stats["by_module"].items():
802
803 linter2 = init_linter
804 if module == "data":
805 linter2.check(os.path.join(os.path.dirname(__file__), "data/__init__.py"))
(Pdb) os.path.dirname(__file__)
'/usr/src/RPM/BUILD/python3-module-pylint-2.4.2/tests'
(Pdb) p module
'data.suppliermodule_test' Thus, the linter gets on its input the dotted name with module notation. > /usr/src/RPM/BUILD/python3-module-pylint-2.4.2/.tox/py37/lib/python3/site-packages/pylint/utils/utils.py(143)expand_modules()
-> filepath = modutils.file_from_modpath(modname.split("."))
(Pdb) modutils.file_from_modpath(modname.split("."))
(Pdb) modname.split(".")
['/usr/src/RPM/BUILD/python3-module-pylint-2', '4', '2/tests/data', 'suppliermodule_test']
(Pdb) modutils.file_from_modpath(modname.split(".")) Thus, import pylint.lint
pylint.lint.Run(["/test/dot.name/tests.module"]) while the following works: import pylint.lint
pylint.lint.Run(["/test/notdotname/tests.module"]) |
astroid takes args from pylint and works as expected. from astroid import modutils
modutils.file_info_from_modpath(["/test/dot.name/tests", "module"]) So, in my opinion |
Thanks @stanislavlevin for the investigation, appreciate it! |
yep this is still happening with 2.4.4:
|
I'm going to close this as the CI is passing and we haven't received many reports about this in recent years. |
Steps to reproduce
pytest
Current behavior
Expected behavior
Test to pass.
pylint --version outputpylint is at 2.4.2.
The text was updated successfully, but these errors were encountered: