--- id: pytest-find-dependencies version: "0.6.0" license: MIT license_treatment: permissive maintenance: active --- # pytest-find-dependencies — A pytest plugin to find dependencies between tests License: permissive · Maintenance: active · Downloads: 983.2K/mo ## 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 above — 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 pip install pytest-find-dependencies uv add pytest-find-dependencies poetry add pytest-find-dependencies ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 983.2K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest test dependency detection, find test order dependencies, test pollution detection, pytest test isolation checker, identify dependent tests, test interdependency analysis, test-isolation, test-debugging [View on SkillFed](https://skillfed.io/packages/pytest-find-dependencies) · [View on PyPI](https://pypi.org/project/pytest-find-dependencies/)