Skip to main content

pytest pylint

https://github.com/carsongee/pytest-pylint/actions/workflows/tests.yml/badge.svg https://img.shields.io/coveralls/carsongee/pytest-pylint.svg https://img.shields.io/pypi/v/pytest-pylint.svg https://anaconda.org/conda-forge/pytest-pylint/badges/version.svg https://anaconda.org/conda-forge/pytest-pylint/badges/downloads.svg https://img.shields.io/pypi/l/pytest-pylint.svg

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.

Sample Usage

py.test --pylint

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 --pylint-jobs=4

This would use the pylintrc file at /my/pyrc, only error on pylint Errors and Failures, and use 4 cores for running pylint.

You can restrict your test run to only perform pylint checks and not any other tests by typing:

py.test --pylint -m pylint

Acknowledgements

This code is heavily based on pytest-flakes

Development

If you want to help development, there is overview documentation

Releases

0.21.0

  • Dropped support for pytest < 7.0 in preparation for pytest 8.0 (should work with it when it comes out)

  • Dropped support for pylint < 2.15 to work better with Python 3.11 and drop backwards compatibility code

  • Use baked in TOML support with fallback to newer tomli library thanks to mgorny

0.20.0

  • Corrected issues introduced by deprecations in pylint

  • Added support for Python 3.12 and dropped support for Python 3.7

  • Last version that will support pytest < 7 and pylint < 2.6

0.19.0

  • Switched to GitHub Actions for CI thanks to michael-k

  • Switched to using smart PyLint RC discovery thanks to bennyrowland

  • Correcting rootdir/rootpath issues in pytest >7.x

  • Deprecated support for Python <3.7

0.18.0

  • Added support for creating missing folders when using --pylint-output-file

  • Now when pylint’s ignore_patterns is blank, we don’t ignore all files

  • Added cache invalidation when your pylintrc changes

  • Verified support for latest pytest and Python 3.9

  • Corrected badly named nodes (duplicated path) thanks to yanqd0

  • Added tests to source distribution thanks to sbraz

0.17.0

  • Added support for latest pylint API >=2.5.1

0.16.1

  • Corrected documentation and correctly pinned dependencies properly

0.16.0

  • Switched to new from_parent API and added development documentation dineshtrivedi

  • Added support for toml based configuration of pylint thanks to michael-k

0.15.1

  • Made –no-pylint functional again

0.15.0

  • Added support for Python 3.8 thanks to michael-k

  • Implemented option to output Pylint results to a reports file thanks to jose-lpa

  • Refactored into simpler plugin structure

0.14.1

  • Corrected pytest-pylint to properly support -p no:cacheprovider thanks to yanqd0

0.14.0

  • Added support for Pylint’s ignore-patterns for regex based ignores thanks to khokhlin

  • pytest-pylint now caches successful pylint checks to speedup test reruns when files haven’t changed thanks to yanqd0

0.13.0

  • Python 3.7 compatibility verified

  • Ignore paths no longer match partial names thanks to heoga

0.12.3

  • jamur2 corrected issue where file paths where not being output properly on lint failures.

0.12.2

  • Resolved issue where failing files weren’t reported thanks to reports from skirpichev and jamur2

0.12.1

  • Corrected a bug preventing this plugin from working with py.test >= 3.7.0.

0.12.0

  • jwkvam added progress output during linting.

0.11.0

  • Added option --no-pylint to override --pylint for cases when it’s turned on by default.

0.10.0

  • jwkvam provided support for pylint 2.0

0.9.0

  • noisecapella added an option to run pylint with multiple processes

0.8.0

  • bdrung corrected inconsistent returns in a function

  • Dropped Python 3.3 support

0.7.1

0.7.0

  • Linting is performed before tests which enables code duplication checks to work along with a performance boost, thanks to @heoga

Metadata

Release files for pytest-pylint 0.21.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-pylint 0.21.0
File Size Uploaded
pytest-pylint-0.21.0.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-pylint 0.21.0
File Interpreter ABI Platform
pytest_pylint-0.21.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.0 kB

Release files / pytest-pylint-0.21.0.tar.gz

Download URL pytest-pylint-0.21.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
88764b8e1d5cfa18809248e0ccc2fc05035f08c35f0b0222ddcfea1c3c4e553e
BLAKE2b-256 checksum
How to use checksums
a3a2760c54166210dbf7ba8b5dcf19b28d388c53569faa412809f6fb652aa588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / pytest_pylint-0.21.0-py3-none-any.whl

Download URL pytest_pylint-0.21.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f10d9eaa72b9fbe624ee4b55da0481f56482eee0a467afc1ee3ae8b1fefbd0b4
BLAKE2b-256 checksum
How to use checksums
a74b23f6ce5187eec09ae282f91d88f6b9e1d871fc89b839dcfd0b94e4591353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.21.0 This release

2 release files

0.19.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.1

3 release files

0.14.0

3 release files

0.13.0

3 release files

0.12.0

4 release files

0.9.0

3 release files

0.8.0

7 release files

0.7.1

7 release files

0.7.0

7 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page