pytest-dependency
Manage dependencies of tests
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 on this page — 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
pytest-dependency on PyPI
pip
pip install pytest-dependencyuv
uv add pytest-dependencypoetry
poetry add pytest-dependencyInstalling 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 the current Python release (>=3.4) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 180 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,908,309/month — #1,579 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_dependency-0.6.1.tar.gz
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
pytest-dependsA pytest plugin that lets you declare…
permissive · top 15,000 on PyPI
pytest-skip-markersA pytest plugin that provides skip markers to…
permissive · top 15,000 on PyPI
pytest-remotedataA pytest plugin that lets you mark and…
permissive · top 15,000 on PyPI
pytest-fixture-configProvides configuration objects and decorators…
permissive · top 15,000 on PyPI
pytest-integrationA pytest plugin that organizes tests into unit,…
permissive · top 15,000 on PyPI
pytest-onlyA pytest plugin that runs only tests marked…
permissive · top 15,000 on PyPI
pytest-find-dependenciesA pytest plugin that identifies dependencies…
permissive · top 5,000 on PyPI
pytest-orderA pytest plugin that lets you control the order…
permissive · top 5,000 on PyPI
pytest-jiraA pytest plugin that links test cases to JIRA…
copyleft · top 15,000 on PyPI
pytest-error-for-skipsA pytest plugin that converts skipped tests…
permissive · top 15,000 on PyPI