skillfed

pytest-dependency

Manage dependencies of tests

pytest-dependency v0.6.1 8.9M downloads/30d#1,579 on PyPI172
Permissive license Apache-2.0 Active released

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-dependency

uv

uv add pytest-dependency

poetry

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 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

Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing

Tags

pytest test dependenciesskip tests based on other testspytest conditional test executionmanage test prerequisitespytest test orderingdependent test managementpytest skip on failure
pytest-plugintest-orchestration

More Testing packages

pluggy

Pluggy provides a plugin system that lets you…

permissive · top 100 on PyPI

pytest

pytest is a testing framework that lets you…

permissive · top 100 on PyPI

virtualenv

virtualenv creates isolated Python environments…

permissive · top 100 on PyPI

coverage

Coverage.py measures which lines of Python code…

permissive · top 1,000 on PyPI

pytest-asyncio

pytest-asyncio is a pytest plugin that enables…

permissive · top 1,000 on PyPI

pytest-json-ctrf

A pytest plugin that generates test reports in…

permissive · top 1,000 on PyPI

pytest-depends

A pytest plugin that lets you declare…

permissive · top 15,000 on PyPI

pytest-skip-markers

A pytest plugin that provides skip markers to…

permissive · top 15,000 on PyPI

pytest-remotedata

A pytest plugin that lets you mark and…

permissive · top 15,000 on PyPI

pytest-fixture-config

Provides configuration objects and decorators…

permissive · top 15,000 on PyPI

pytest-integration

A pytest plugin that organizes tests into unit,…

permissive · top 15,000 on PyPI

pytest-only

A pytest plugin that runs only tests marked…

permissive · top 15,000 on PyPI

pytest-find-dependencies

A pytest plugin that identifies dependencies…

permissive · top 5,000 on PyPI

pytest-order

A pytest plugin that lets you control the order…

permissive · top 5,000 on PyPI

pytest-jira

A pytest plugin that links test cases to JIRA…

copyleft · top 15,000 on PyPI

pytest-error-for-skips

A pytest plugin that converts skipped tests…

permissive · top 15,000 on PyPI