Pylint Pytest Plugin

1.1.8 · active · verified Tue Apr 14

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.

Warnings

Install

Imports

Quickstart

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

view raw JSON →