--- id: pytest-dependency version: "0.6.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pytest-dependency — Manage dependencies of tests License: permissive · Maintenance: active · Downloads: 8.9M/mo ## What it is and what it does pytest-dependency is a pytest plugin that lets you declare test dependencies—marking some tests as dependent on the success of other tests. When a test is marked as dependent on another, it will be automatically skipped if any of its dependencies fail or are themselves skipped. This is useful for test suites where later tests logically depend on earlier setup or validation steps succeeding. The plugin integrates directly into pytest's test collection and execution flow. It has no external runtime dependencies and supports Python versions from 3.4 through 3.14. The package is actively maintained, with a recent commit history and a permissive Apache 2.0 license that allows both commercial and private use. Use it for: - Skip integration tests when their setup fixture test fails, avoiding cascading false failures. - Manage test suites where database migration tests must pass before data validation tests run. - Conditionally run cleanup or teardown tests only if their corresponding setup tests succeeded. - Build test pipelines where later stages depend on earlier stages completing successfully. - Reduce test noise by skipping dependent tests rather than letting them fail due to unmet preconditions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that marks tests as dependent on other tests, automatically skipping dependents when their prerequisites fail or are skipped. Yes, if you have a test suite with explicit dependencies between tests. The plugin is actively maintained, has no external runtime dependencies, and carries a permissive license. The high install friction is a minor concern; verify whether it affects your environment. For simple test suites without inter-test dependencies, it adds no value. ## Install pip install pytest-dependency uv add pytest-dependency poetry add pytest-dependency ## Installing pytest-dependency Before you install: High install friction with no runtime dependencies. The package itself is a pytest plugin with zero external runtime requirements, but the friction rating suggests potential build or environment setup complexity during installation. License in practice: Licensed under Apache License 2.0 (permissive). You may use, modify, and distribute this package freely in commercial and private projects, provided you include a copy of the license and state any material changes. Quickstart: pip install pytest-dependency # In your test file: import pytest @pytest.mark.dependency() def test_setup(): pass @pytest.mark.dependency(depends_on=['test_setup']) def test_dependent(): pass Requires pytest to be installed; pytest-dependency is a plugin and will not function standalone. Verify before relying: - Whether the high install friction stems from compiled dependencies, system libraries, or other environmental factors not evident from the package metadata. - Current maintenance activity level beyond the last commit date (2026-02-15) and whether active development continues. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: high - Maintenance: active - Downloads: 8.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest test dependencies, skip tests based on other tests, pytest conditional test execution, manage test prerequisites, pytest test ordering, dependent test management, pytest skip on failure, pytest-plugin, test-orchestration [View on SkillFed](https://skillfed.io/packages/pytest-dependency) · [View on PyPI](https://pypi.org/project/pytest-dependency/)