forked from PyCQA/pylint-pytest
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Pretty straightforward. If I have
- a global variable
jobs
> 1- pylint_pytest as an enabled plugin
I get a flurry of exceptions, seemingly starting with a RecursionError: maximum recursion depth exceeded in comparison
.
To Reproduce
Package versions
$ pip freeze
astroid==3.3.11
dill==0.4.0
exceptiongroup==1.3.0
importlib_metadata==8.7.0
iniconfig==2.1.0
isort==6.1.0
mccabe==0.7.0
packaging==25.0
platformdirs==4.4.0
pluggy==1.6.0
pylint==3.3.9
pylint-pytest==1.1.8
pytest==8.2.0
tomli==2.2.1
tomlkit==0.13.3
typing_extensions==4.15.0
zipp==3.23.0
$ python --version
Python 3.9.20
File content
.pylintrc:
[MASTER]
load-plugins=pylint_pytest
jobs=4
my_file.py:
def mainroutine():
global foo
if __name__ == "__main__":
mainroutine()
Pylint output with the plugin
$ pylint my_file.py
Exception on node <Global l.2 at 0x7f514f6cbeb0> in file '/home/ktm/python/pylint-test/my_file.py'
Traceback (most recent call last):
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/utils/ast_walker.py", line 87, in walk
callback(astroid)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/checkers/variables.py", line 1643, in visit_global
self.add_message(
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 314, in patch_add_message
FixtureChecker._original_add_message(self, msgid, line, node, args, confidence, col_offset)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 314, in patch_add_message
FixtureChecker._original_add_message(self, msgid, line, node, args, confidence, col_offset)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 314, in patch_add_message
FixtureChecker._original_add_message(self, msgid, line, node, args, confidence, col_offset)
[Previous line repeated 963 more times]
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 244, in patch_add_message
if msgid == "unused-import":
RecursionError: maximum recursion depth exceeded in comparison
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/pylinter.py", line 831, in _check_file
check_astroid_module(ast_node)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/pylinter.py", line 1020, in check_astroid_module
retval = self._check_astroid_module(
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/pylinter.py", line 1072, in _check_astroid_module
walker.walk(node)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/utils/ast_walker.py", line 90, in walk
self.walk(child)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/utils/ast_walker.py", line 90, in walk
self.walk(child)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/utils/ast_walker.py", line 87, in walk
callback(astroid)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/checkers/variables.py", line 1643, in visit_global
self.add_message(
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 314, in patch_add_message
FixtureChecker._original_add_message(self, msgid, line, node, args, confidence, col_offset)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 314, in patch_add_message
FixtureChecker._original_add_message(self, msgid, line, node, args, confidence, col_offset)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 314, in patch_add_message
FixtureChecker._original_add_message(self, msgid, line, node, args, confidence, col_offset)
[Previous line repeated 963 more times]
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint_pytest/checkers/fixture.py", line 244, in patch_add_message
if msgid == "unused-import":
RecursionError: maximum recursion depth exceeded in comparison
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib64/python3.9/concurrent/futures/process.py", line 246, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/lib64/python3.9/concurrent/futures/process.py", line 205, in _process_chunk
return [fn(*args) for args in chunk]
File "/usr/lib64/python3.9/concurrent/futures/process.py", line 205, in <listcomp>
return [fn(*args) for args in chunk]
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/parallel.py", line 79, in _worker_check_single_file
_worker_linter.check_single_file_item(file_item)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/pylinter.py", line 740, in check_single_file_item
self._check_file(self.get_ast, check_astroid_module, file)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/pylinter.py", line 833, in _check_file
raise astroid.AstroidError from e
astroid.exceptions.AstroidError
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ktm/python/pylint-test/venv/bin/pylint", line 7, in <module>
sys.exit(run_pylint())
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/__init__.py", line 34, in run_pylint
PylintRun(argv or sys.argv[1:])
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/run.py", line 240, in __init__
linter.check(args)
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/pylinter.py", line 679, in check
check_parallel(
File "/home/ktm/python/pylint-test/venv/lib64/python3.9/site-packages/pylint/lint/parallel.py", line 153, in check_parallel
for (
File "/usr/lib64/python3.9/concurrent/futures/process.py", line 562, in _chain_from_iterable_of_lists
for element in iterable:
File "/usr/lib64/python3.9/concurrent/futures/_base.py", line 609, in result_iterator
yield fs.pop().result()
File "/usr/lib64/python3.9/concurrent/futures/_base.py", line 446, in result
return self.__get_result()
File "/usr/lib64/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
astroid.exceptions.AstroidError
Expected behavior
No crash!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working