--- id: pytest-deadfixtures version: "3.1.0" license: MIT license_treatment: permissive maintenance: aging --- # pytest-deadfixtures — A simple plugin to list unused fixtures in pytest License: permissive · Maintenance: aging · Downloads: 1.0M/mo ## What it is and what it does pytest-deadfixtures is a pytest plugin that analyzes your test suite to report fixtures that are never used and fixtures that may be duplicated. It runs as a separate pytest invocation with command-line flags and does not execute your tests during analysis, making it suitable for CI pipelines when run after the main test suite. The plugin offers three main features: listing unused fixtures with their location and docstring, identifying potentially duplicate fixtures by comparing return values, and ignoring specific fixtures via a @deadfixtures_ignore decorator. It's designed as a code-quality tool to help maintain lean test suites by surfacing fixture debt. Use it for: - Audit an existing test suite to find fixtures defined but never referenced by any test. - Detect duplicate fixture definitions that provide the same test data or setup, reducing maintenance burden. - Integrate into CI to enforce fixture hygiene by running --dead-fixtures after the main test suite passes. - Mark intentionally unused fixtures with @deadfixtures_ignore to exclude them from reports without removing them. - Review fixture usage patterns with verbose output to understand which fixtures are actually exercised. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that identifies unused and duplicated fixtures in your test suite, helping you clean up test code and catch redundant fixture definitions. Yes, if you maintain a pytest suite and want to identify fixture bloat. The plugin is stable, has no security vulnerabilities, and low install friction. The aging maintenance status (211 days since last release) is a minor concern but not a blocker—the package is not archived and works with modern Python versions. Use it as a periodic audit tool rather than a blocking CI gate. ## Install pip install pytest-deadfixtures uv add pytest-deadfixtures poetry add pytest-deadfixtures ## Installing pytest-deadfixtures Before you install: Low install friction with a single runtime dependency on pytest. Maintenance status is aging—last release was 211 days ago—but the repository is not archived and the package is marked Production/Stable. License in practice: MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install pytest-deadfixtures # In your test directory, run: pytest --dead-fixtures # To find duplicates: pytest --dup-fixtures Verify before relying: - Whether the aging maintenance status (211 days since last release) affects compatibility with the latest pytest versions. - How the duplicate detection handles fixtures with falsy return values, beyond the documented skip behavior. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest unused fixtures, find dead fixtures, duplicate fixtures detection, pytest fixture cleanup, test fixture analysis, pytest code quality, fixture linting, pytest-plugin, test-quality, fixture-analysis [View on SkillFed](https://skillfed.io/packages/pytest-deadfixtures) · [View on PyPI](https://pypi.org/project/pytest-deadfixtures/)