Run pylint with pytest and have configurable rule types (i.e. Convention, Warn, and Error) fail the build. You can also specify a pylintrc file.
would be the most simple usage and would run pylint for all error messages.
py.test --pylint --pylint-rcfile=/my/pyrc --pylint-error-types=EF
This would use the pylintrc file at /my/pyrc and only error on pylint Errors and Failures.
You can restrict your test run to only perform pylint checks and not any other tests by typing:
py.test --pylint -m pylint
This code is heavily based on pytest-flakes
- bdrung corrected inconsitent returns in a function
- Dropped Python 3.3 support
- Corrected path issue reported by Kargathia
- Linting is performed before tests which enables code duplication checks to work along with a performance boost, thanks to @heoga