pytest-pylint
pytest plugin to check source code with pylint
What it is and what it does
pytest-pylint is a pytest plugin that runs pylint static analysis checks as part of your test suite. Instead of running pylint separately, you invoke it through pytest with the `--pylint` flag, and it lints your source code according to your pylintrc configuration. You can choose which pylint message types (Errors, Failures, Warnings, Conventions) cause the test to fail, run linting in parallel across multiple cores, and optionally output results to a file. The plugin caches successful lint checks to speed up reruns when files haven't changed.
The package depends on pytest, pylint, and tomli (for TOML configuration support). It's designed for teams that want linting feedback integrated into their continuous test workflow rather than as a separate CI step, and it supports regex-based ignore patterns and smart pylintrc discovery.
Use it for:
- Enforce code quality gates in CI/CD by failing the build on pylint errors or warnings during test runs.
- Run linting checks in parallel across multiple CPU cores to speed up large codebases.
- Restrict test execution to only pylint checks (skipping unit tests) with `py.test --pylint -m pylint`.
- Cache lint results between test reruns to avoid re-linting unchanged files.
- Integrate custom pylintrc files and ignore patterns into your pytest workflow without separate configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates pylint code analysis into pytest, allowing you to run linting checks as part of your test suite and configure which rule types (errors, warnings, conventions) cause test failures.
Yes, if you want linting integrated into pytest and your project targets Python 3.8–3.12 with pytest >= 7.0 and pylint >= 2.15. The plugin is stable and low-friction to install, but dormant maintenance means it won't receive updates for new pytest or pylint versions—verify compatibility with your specific versions before relying on it in new projects.
Install
pytest-pylint on PyPI
pip
pip install pytest-pylintuv
uv add pytest-pylintpoetry
poetry add pytest-pylintInstalling pytest-pylint
Before you install
Low friction install with three straightforward runtime dependencies. Maintenance is dormant—last release was over a year ago—but the package is marked Production/Stable and supports current Python versions. No recent activity suggests the plugin works as-is for its scope.
License in practice
MIT license is permissive; you can use, modify, and distribute this plugin freely with minimal restrictions, making it suitable for both open-source and proprietary projects.
Quickstart
pip install pytest-pylint
# In your test run:
py.test --pylint
# Or with options:
py.test --pylint --pylint-rcfile=/path/to/.pylintrc --pylint-error-types=EF
Requires pylint >= 2.15 and pytest >= 7.0; Python >= 3.7 required.
Verify before relying
- Whether the plugin works correctly with pytest 8.0+ (description notes it 'should work' but lacks confirmation).
- Current status of any compatibility issues with the latest pylint releases beyond 2.15.
- Practical experience with the plugin on Python 3.12 in production environments.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pytest, pylint, tomli |
| Maintenance | dormant — 1,043 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 616,413/month — #5,741 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_pylint-0.21.0-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
pytest-ruffA pytest plugin that integrates ruff code…
unclear · top 15,000 on PyPI
pylint-per-file-ignoresA pylint plugin that lets you specify which…
permissive · top 15,000 on PyPI
pylint-exitTranslates pylint's bit-encoded exit codes into…
permissive · top 15,000 on PyPI
pylint-pytestA Pylint plugin that suppresses false-positive…
permissive · top 15,000 on PyPI
pytest-pep8A pytest plugin that integrates PEP8 style…
permissive · top 15,000 on PyPI
pylint-pydanticA Pylint plugin that extends Pylint's…
copyleft · top 5,000 on PyPI
pylint-odooA Pylint plugin that adds Odoo-specific code…
agpl · top 15,000 on PyPI
pylint-junitGenerates JUnit-formatted XML reports from…
permissive · top 15,000 on PyPI
fixitFixit is a configurable linting framework built…
permissive · top 15,000 on PyPI
mypy_baselineA CLI tool that captures mypy type errors as a…
permissive · top 15,000 on PyPI