{"id":6057,"library":"pylint-pytest","title":"Pylint Pytest Plugin","description":"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.","status":"active","version":"1.1.8","language":"en","source_language":"en","source_url":"https://github.com/pylint-dev/pylint-pytest","tags":["pylint","pytest","linter","testing","plugin","static analysis"],"install":[{"cmd":"pip install pylint-pytest","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core linter; pylint-pytest v1.1.7+ requires Pylint v3 or newer.","package":"pylint","optional":false},{"reason":"Testing framework; pylint-pytest v1.1.8 has known compatibility issues with pytest versions greater than 8.2.0.","package":"pytest","optional":false}],"imports":[{"note":"Pylint plugins are loaded via command-line flags or configuration files (e.g., .pylintrc, pyproject.toml), not directly imported in Python source code.","wrong":"import pylint_pytest # (in Python code)","symbol":"pylint_pytest","correct":"pylint --load-plugins pylint_pytest your_module.py"}],"quickstart":{"code":"import pytest\n\ndef my_fixture():\n    return 42\n\ndef test_example(my_fixture):\n    \"\"\"This test uses a fixture, which Pylint might incorrectly flag as unused.\"\"\"\n    assert my_fixture == 42\n\n# To run pylint with the plugin:\n# Save the above as `test_module.py`\n# Then run: pylint --load-plugins pylint_pytest test_module.py","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade Pylint to version 3.x or higher: `pip install 'pylint>=3.0.0'`.","message":"Versions 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`.","severity":"breaking","affected_versions":">=1.1.7"},{"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.","message":"Version 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.","severity":"gotcha","affected_versions":"1.1.8"},{"fix":"Ensure your project uses Python 3.10 or newer when upgrading to `pylint-pytest` v2.x.","message":"Alpha 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.","severity":"breaking","affected_versions":">=2.0.0a0"},{"fix":"Refactor your fixtures to use `pytest.fixture` with a `yield` statement directly, as `pytest.yield_fixture` has been deprecated.","message":"The `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.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}