Registry / testing / pylint-pytest

pylint-pytest

JSON →
library1.1.8pypypiunverified

pylint-pytest is a Pylint plugin designed to suppress common false positives that arise when Pylint analyzes code written for Pytest, such as `unused-argument` for fixtures. The current version is 1.1.8, with active development including a v2.0.0 alpha series indicating ongoing significant updates and a regular release cadence.

pip install pylint-pytest
INSTALL
IMPORT
SIG · PYLINT-PYTEST
P
pylint-pytest
testingpythonv1.1.8
Install
3.1s avg
Import
—
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.1.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.5MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 3.1s · import 0.000s · 31MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pylint_pytest
✓ pylint --load-plugins pylint_pytest your_module.py
✗ import pylint_pytest # (in Python code)
Pylint plugins are loaded via command-line flags or configuration files (e.g., .pylintrc, pyproject.toml), not directly imported in Python source code.

Install the plugin, then invoke Pylint using the `--load-plugins` option or configure it in your Pylint configuration file (e.g., `pyproject.toml` or `.pylintrc`) to enable the plugin. This prevents false positives related to pytest fixtures and test functions.

import pytest def my_fixture(): return 42 def test_example(my_fixture): """This test uses a fixture, which Pylint might incorrectly flag as unused.""" assert my_fixture == 42 # To run pylint with the plugin: # Save the above as `test_module.py` # Then run: pylint --load-plugins pylint_pytest test_module.py
Debug
Known issues
breakingVersions 1.1.7 and later of `pylint-pytest` require Pylint v3 or newer due to backward-incompatible changes in Pylint's API. Users on older Pylint versions must upgrade Pylint or stick to `pylint-pytest < 1.1.7`.
fix
Upgrade Pylint to version 3.x or higher: `pip install 'pylint>=3.0.0'`.
affects: >=1.1.7
gotchaVersion 1.1.8 of `pylint-pytest` has a known compatibility issue with `pytest` versions greater than `8.2.0` that can cause errors during linting.
fix
Pin your `pytest` version to `<=8.2.0` if you encounter issues with `pylint-pytest==1.1.8` (e.g., `pip install 'pytest<=8.2.0'`). Consult the `pylint-pytest` changelog for updates on this compatibility.
affects: 1.1.8
breakingAlpha versions for `pylint-pytest` 2.0.0 (e.g., v2.0.0a1) have dropped support for Python 3.8 and 3.9, aligning with broader dependency deprecations.
fix
Ensure your project uses Python 3.10 or newer when upgrading to `pylint-pytest` v2.x.
affects: >=2.0.0a0
deprecatedThe `pylint-pytest` plugin will raise a `W6401 deprecated-pytest-yield-fixture` warning if you use the `@pytest.yield_fixture` decorator, which is deprecated in Pytest.
fix
Refactor your fixtures to use `pytest.fixture` with a `yield` statement directly, as `pytest.yield_fixture` has been deprecated.
affects: *
Upgrade
Version history
1.1.8latest on PyPI · released May 23, 2024
Audit
Dependencies
pylintrequiredCore linter; pylint-pytest v1.1.7+ requires Pylint v3 or newer.
pytestrequiredTesting framework; pylint-pytest v1.1.8 has known compatibility issues with pytest versions greater than 8.2.0.
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
pylint-pytest — pip install pylint-pytest · libregistry