Skip to content

pylint version too permissive

Summary

When attempting to run tests locally, it appears that the version of pylint and pytest_pylint are not compatible. As a result, when these incompatible versions are used, tests are not able to run.

The change in question which causes this incompatibility can be found at https://github.com/PyCQA/pylint/commit/4210ef9b8c5d9e7b33ff0542683f18b8031193fa#diff-ade2cfcf3e840a993dbd465f517d91f5L1189 .

Steps to reproduce

Perform a test locally. When using pytest_pylint 0.9.0 and pylint 2.0.0, the bug behavior is observed.

What is the current bug behavior?

An exception is thrown stating that pylint is being using incorrectly:

Linting files
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pytest-3.6.1-py3.6.egg/_pytest/main.py", line 178, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pytest-3.6.1-py3.6.egg/_pytest/main.py", line 214, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pytest-3.6.1-py3.6.egg/_pytest/main.py", line 224, in pytest_collection
INTERNALERROR>     return session.perform_collect()
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pytest-3.6.1-py3.6.egg/_pytest/main.py", line 432, in perform_collect
INTERNALERROR>     hook.pytest_collection_finish(session=self)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pluggy-0.6.0-py3.6.egg/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/dplayle/Code/kittyhawk/bst-build/buildstream/.eggs/pytest_pylint-0.9.0-py3.6.egg/pytest_pylint.py", line 161, in pytest_collection_finish
INTERNALERROR>     result = lint.Run(args_list, reporter=reporter, exit=False)
INTERNALERROR> TypeError: __init__() got an unexpected keyword argument 'exit'

What is the expected correct behavior?

The tests should run without an exception halting the testing process.

Relevant logs and/or screenshots

See above.

Possible fixes

Restrict down the allowable versions of pylint.

Other relevant information

  • BuildStream version affected: issue present at 73b93002

Edited by Daniel Playle
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information