skillfed

pytest-ruff

pytest plugin to check ruff requirements.

pytest-ruff v0.5 188.7K downloads/30d#9,939 on PyPI36
License unclear AGING released

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-ruff

uv

uv add pytest-ruff

poetry

poetry add pytest-ruff

Installing 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

Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

pytest ruff integrationruff linting in pytestcode quality checks pytestruff format validationpytest code style plugin
pytest-plugincode-qualitylinting

More Python Modules packages