pytest-ruff
pytest plugin to check ruff requirements.
What it is and what it does
pytest-ruff is a pytest plugin that embeds ruff linting and formatting checks into your test pipeline. Instead of running ruff separately from your test suite, you invoke it via pytest flags (--ruff and --ruff-format) and the plugin executes one ruff validation per file, failing the test run if any file violates ruff rules or has formatting issues.
The plugin respects standard ruff configuration files (pyproject.toml or ruff.toml) in your project, so you configure it the same way you would standalone ruff. It depends only on pytest and ruff, both common tools, and supports Python 3.8 through 3.13. The project is in beta status and has not been updated for 421 days, though the repository remains unarchived and has seen recent activity.
Use it for:
- Run ruff checks alongside unit tests in a single pytest invocation to catch style and formatting issues early.
- Enforce code quality gates in CI/CD by failing the build if ruff detects violations, without a separate linting step.
- Validate both code logic and formatting in one test command, reducing the number of separate tools developers need to invoke locally.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that integrates ruff code linting and formatting checks into your test suite, running ruff validation as part of pytest.
Yes, if you want to consolidate ruff linting into your pytest workflow and accept the aging maintenance status. The plugin has low install friction, no known vulnerabilities, and works with current Python versions. However, verify that it remains compatible with your versions of pytest and ruff, and clarify the license metadata before using it in a compliance-sensitive context.
Install
pytest-ruff on PyPI
pip
pip install pytest-ruffuv
uv add pytest-ruffpoetry
poetry add pytest-ruffInstalling pytest-ruff
Before you install
Low install friction with only pytest and ruff as runtime dependencies. Maintenance status is aging—last release was 421 days ago, though the repository remains active with a recent commit on 2025-07-27.
License in practice
License treatment is unclear in the metadata, though the description states distribution under MIT terms; verify the actual license file in the repository before relying on it for compliance.
Quickstart
pip install pytest-ruff
# In your test run:
pytest --ruff --ruff-format
# The plugin runs one ruff check per file and fails if code violates ruff rules.
Requires pytest and ruff to be installed; ruff configuration can be customized via pyproject.toml or ruff.toml in your project directory.
Verify before relying
- Whether the unclear license metadata reflects an actual licensing ambiguity or a metadata-only gap that the MIT statement in the description resolves.
- Current test coverage and whether the aging maintenance status indicates the plugin remains compatible with recent ruff and pytest releases.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pytest, ruff |
| Maintenance | aging — 421 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 188,749/month — #9,939 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_ruff-0.5-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytest-pylintIntegrates pylint code analysis into pytest,…
permissive · top 15,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pytest-blackA pytest plugin that runs black format checks…
permissive · top 15,000 on PyPI
python-lsp-ruffIntegrates ruff's linting, formatting, and…
permissive · top 15,000 on PyPI
ruff-formatProvides Python bindings to Ruff's code…
permissive · top 15,000 on PyPI
bar-raiserBar-Raiser creates GitHub checks with inline…
permissive · top 15,000 on PyPI
prophecy-libsProvides runtime support and helper utilities…
copyleft · top 15,000 on PyPI
pytest-retrypytest-retry is a pytest plugin that…
permissive · top 5,000 on PyPI
pytest-examplesA pytest plugin that finds, lints, runs, and…
permissive · top 15,000 on PyPI
pytest-sparkA pytest plugin that integrates Apache Spark…
permissive · top 15,000 on PyPI