pytest-find-dependencies
A pytest plugin to find dependencies between tests
What it is and what it does
pytest-find-dependencies is a pytest plugin that automates the detection of test interdependencies—situations where one test's success or failure depends on the execution of another test. Tests should ideally be independent, but in practice many codebases accumulate hidden dependencies that only surface when test order changes. This plugin runs your test suite in both forward and reverse order, then uses binary search on any failing tests to isolate the specific test causing the failure.
The plugin reports found dependencies clearly and can also flag tests that fail permanently after all tests run, indicating environmental side effects that weren't cleaned up. It integrates with pytest's command-line interface via the `--find-dependencies` flag and supports options to run tests serially, ignore specific test markers, and control exit codes. It detects pytest-xdist and disables distribution for its internal test runs to preserve ordering.
Use it for:
- Identify hidden test dependencies in a legacy test suite before refactoring or parallelizing tests.
- Debug why tests pass in isolation but fail in a full run—pinpoint the offending test automatically.
- Verify test cleanup: detect tests that leave permanent state changes (e.g., database records) affecting later tests.
- Ensure test order independence before adopting parallel test runners like pytest-xdist.
- Validate that test markers from ordering plugins (pytest-order, pytest-dependency) are working as intended.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that identifies dependencies between tests by running them in multiple orders and using binary search to pinpoint which test causes another to fail.
Yes. The plugin solves a real problem—hidden test dependencies are common and hard to find manually. It has low install friction, active maintenance, permissive licensing, no known vulnerabilities, and runs on modern Python versions. Use it if you suspect test interdependencies or want to verify test isolation before parallelizing; the runtime overhead is modest and the diagnostic value is high.
Install
pytest-find-dependencies on PyPI
pip
pip install pytest-find-dependenciesuv
uv add pytest-find-dependenciespoetry
poetry add pytest-find-dependenciesInstalling pytest-find-dependencies
Before you install
Low install friction with a single runtime dependency on pytest. Actively maintained as of 2025-07-16 with recent commits; the repository is not archived and has received updates within the past year.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install pytest-find-dependencies
pytest --find-dependencies
# Output shows which tests depend on others, e.g.:
# test_one.py::test_b depends on test_one.py::test_e
Requires pytest to be installed; Python 3.9 or later.
Verify before relying
- Whether the binary search approach reliably catches all test dependencies or only a subset in practice.
- Performance impact on large test suites beyond the documented 1.5x to 2x slowdown estimates.
- How well permanent environment changes (e.g., database state) are detected in parallel vs. serial mode.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | actively maintained — 394 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 983,229/month — #4,582 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_find_dependencies-0.6.0-py3-none-any.whl
Keywords: testing, pytest, dependencies
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
detect-test-pollutionDetects test pollution—failures caused by side…
permissive · top 15,000 on PyPI
pytest-orderA pytest plugin that lets you control the order…
permissive · top 5,000 on PyPI
pytest-loggingA pytest plugin that configures Python logging…
permissive · top 15,000 on PyPI
pytest-reverseA pytest plugin that runs tests in reverse…
permissive · top 15,000 on PyPI
pytest-flakefinderA pytest plugin that runs tests multiple times…
permissive · top 5,000 on PyPI
pytest-timestamperA pytest plugin that prefixes each test output…
unclear · top 15,000 on PyPI
pytest-randomlyA pytest plugin that randomly shuffles test…
permissive · top 5,000 on PyPI
pytest-error-for-skipsA pytest plugin that converts skipped tests…
permissive · top 15,000 on PyPI
pytest-helpers-namespaceProvides a pytest namespace for registering and…
permissive · top 15,000 on PyPI
pytest-dependencyA pytest plugin that marks tests as dependent…
permissive · top 5,000 on PyPI