{"library":"pytest-ruff","title":"pytest-ruff","description":"pytest-ruff is a pytest plugin designed to integrate Ruff's powerful linting and formatting checks directly into your test suite. It automatically runs `ruff format --check` and `ruff check` as part of your `pytest` execution, failing tests if any Ruff requirements are not met. The current version is 0.5, and it maintains a consistent release cadence with updates addressing bug fixes and new features.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install pytest-ruff"],"cli":null},"imports":["This is a pytest plugin and does not typically require direct Python imports in user code. Its functionality is enabled via pytest command-line arguments."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Save as pyproject.toml\n[tool.ruff]\n# By default, Ruff enables 'E' (pycodestyle errors) and 'F' (Pyflakes rules).\n# Ensure these are active or extend with your desired rules.\nselect = [\"E\", \"F\"]\n\n# Save as test_example.py\ndef test_linting_violation():\n    x = 1; y = 2  # E702: Multiple statements on one line (will be flagged by Ruff)\n    assert x < y\n\n# Run from your terminal in the same directory:\n# pytest --ruff\n# Expected output will show a failure due to the E702 Ruff violation.","lang":"python","description":"To quickly verify `pytest-ruff` is working, create a `pyproject.toml` to configure Ruff and a `test_example.py` file with a deliberate Ruff violation. Then, run pytest with the `--ruff` flag. The test suite should report a failure originating from the Ruff check.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}