pytest-deadfixtures
A simple plugin to list unused fixtures in pytest
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 on this page — 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
pytest-deadfixtures on PyPI
pip
pip install pytest-deadfixturesuv
uv add pytest-deadfixturespoetry
poetry add pytest-deadfixturesInstalling 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 | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | aging — 211 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,021,674/month — #4,490 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_deadfixtures-3.1.0-py2.py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
fixturesProvides a reusable fixture contract for unit…
permissive · top 15,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
pytest-lazy-fixturesAllows you to reference pytest fixtures…
permissive · top 5,000 on PyPI
pytest-plusA pytest plugin that adds optional test-count…
permissive · top 15,000 on PyPI
pytest-redisA pytest plugin that provides fixtures for…
copyleft · top 15,000 on PyPI
vultureVulture is a static code analyzer that finds…
permissive · top 5,000 on PyPI
pytest-printAdds fixtures to pytest that print messages…
permissive · top 15,000 on PyPI
pytest-custom-exit-codeA pytest plugin that lets you customize the…
permissive · top 5,000 on PyPI
pytest-rabbitmqA pytest plugin that provides fixtures to start…
copyleft · top 15,000 on PyPI
pytest-dockerpytest-docker provides pytest fixtures that…
permissive · top 5,000 on PyPI