$npx skillfedfor your agent

pytest-unused-fixtures

A pytest plugin to list unused fixtures after a test run.

Worth itPyPI TestingReleased Dec 2025317.1K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_unused_fixtures-0.3.1-py3-none-any.whl
v0.3.1 · released 2025-12-23 · Python <4.0,>=3.9 · 1 runtime deps: pytest

Yes. This is a low-friction, actively maintained plugin that solves a real test maintenance problem—identifying dead fixture code—with no security concerns and a permissive license. It integrates seamlessly into pytest workflows and is useful for any project that wants to keep its test fixtures clean and intentional.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires pytest to be installed; the plugin only works as a pytest plugin and cannot be used standalone.
  • Low friction install as a pure Python wheel with only pytest as a runtime dependency.
  • The project is actively maintained with recent releases and a clean commit history.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use this plugin freely in commercial and private projects with minimal restrictions.

last release 2025-12-23 (234 days) · last repo commit 2026-03-16 · 14 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 317,150 downloads/mo, #7,665 on PyPI

Verify before relying

pip install pytest-unused-fixtures

pytest tests --unused-fixtures

# To fail the test session if unused fixtures are found:
pytest tests --unused-fixtures --unused-fixtures-fail-when-present
  • Whether the plugin accurately detects fixtures used via dynamic pytest mechanisms beyond simple parameter injection.
  • Performance impact when scanning large test suites with many fixtures.
Same gist for agents: .md · .json

What it is and what it does

pytest-unused-fixtures is a pytest plugin that runs after your tests complete and compares all fixtures available in your test collection against those actually used during the test run. It then reports which fixtures were never invoked, grouped by their definition location. This helps identify dead code in your test fixtures that can be safely removed or refactored.

The plugin requires actual test execution to work accurately because pytest supports dynamic fixture requests that static analysis cannot catch. You enable it by passing the `--unused-fixtures` flag to pytest. It offers several configuration options: you can ignore specific paths, limit the scan to particular directories, mark individual fixtures to skip reporting with a decorator, and optionally fail the test session if unused fixtures are found.

Use it for

  • Clean up test fixture cruft by identifying fixtures that were created but never actually used in any test.
  • Enforce fixture hygiene in CI/CD by failing the build when unused fixtures are detected, using `--unused-fixtures-fail-when-present`.
  • Scope fixture analysis to specific test directories to focus cleanup efforts on particular modules or packages.
  • Exclude intentionally unused fixtures (e.g., those reserved for skipped tests) using the `@ignore_unused_fixture` decorator.
  • Audit legacy test suites to understand which fixtures are truly active versus which can be removed.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a low-friction, actively maintained plugin that solves a real test maintenance problem—identifying dead fixture code—with no security concerns and a permissive license. It integrates seamlessly into pytest workflows and is useful for any project that wants to keep its test fixtures clean and intentional.

Install

pytest-unused-fixtures on PyPI

Before you install

Low friction install as a pure Python wheel with only pytest as a runtime dependency. The project is actively maintained with recent releases and a clean commit history.

Requires pytest to be installed; the plugin only works as a pytest plugin and cannot be used standalone.

License in practice

MIT license is permissive; you can use this plugin freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pytest-unused-fixtures

pytest tests --unused-fixtures

# To fail the test session if unused fixtures are found:
pytest tests --unused-fixtures --unused-fixtures-fail-when-present

Verify before relying

  • Whether the plugin accurately detects fixtures used via dynamic pytest mechanisms beyond simple parameter injection.
  • Performance impact when scanning large test suites with many fixtures.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pytest
MaintenanceActively maintained 234 days since the last release
Last repo commit
First released
Downloads317,150 / month, #7,665 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Testing

Evidence: pytest_unused_fixtures-0.3.1-py3-none-any.whl

Tags

Capabilities
pytest unused fixtures detectionfind dead fixtures pytestpytest fixture cleanupunused test fixtures reportpytest fixture analysisidentify unused fixturespytest fixture linter
Topics
pytest-plugintest-maintenancecode-quality
PyPI keywords
pytestfixtures

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pytest unused fixtures detection”

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also django-dynamic-fixture · pytest-deadfixtures · fixtures · pytest-print · cppclean · pytest-durations · pytest-docker · pylint-pytest · pytest-lazy-fixtures · pytest-shutil