pytest-integration
Organizing pytests by integration or not
What it is and what it does
pytest-integration is a pytest plugin that adds markers and command-line options to organize tests into three tiers: unit tests, integration tests, and slow integration tests. It enforces a sequential execution order—unit tests run first, then integration tests only if all units pass, then slow integration tests only if integration tests pass. This prevents wasting time on expensive integration tests when the codebase has basic failures. If pytest-cov is installed, the plugin automatically disables coverage reporting for integration tests, since unit tests are expected to provide full coverage.
The plugin adds two markers (`@pytest.mark.integration_test` and `@pytest.mark.slow_integration_test`) and three command-line flags (`--with-integration`, `--with-slow-integration`, and `--integration-cover`) to control which tiers run and whether integration tests contribute to coverage. It has no runtime dependencies beyond pytest itself, making it lightweight to add to an existing test suite.
Use it for:
- Separate unit tests from integration tests in a CI/CD pipeline to fail fast on logic errors before running expensive external-service tests.
- Mark database or API tests as slow integration tests to run them last, only when quick tests pass.
- Disable coverage collection for integration tests to keep coverage reports focused on unit-test coverage.
- Organize a large test suite where some tests require external services or take significant time to run.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that organizes tests into unit, integration, and slow integration tiers, running them sequentially and skipping later tiers if earlier ones fail.
Yes, if you have an existing pytest suite and want to organize tests by tier with minimal setup. No, if you need active maintenance or support for the latest pytest features—the package is abandoned and has not been updated since 2023. Consider it stable for simple use cases but risky for projects that upgrade pytest frequently or need ongoing compatibility fixes.
Install
pytest-integration on PyPI
pip
pip install pytest-integrationuv
uv add pytest-integrationpoetry
poetry add pytest-integrationInstalling pytest-integration
Before you install
Low friction installation with no runtime dependencies. However, the package is abandoned—last release was 1366 days ago with no commits since 2023-04-07. It still supports current Python versions but receives no maintenance.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution.
Quickstart
pip install pytest-integration
# In your test file:
import pytest
@pytest.mark.integration_test
def test_api_call():
pass
@pytest.mark.slow_integration_test
def test_database_sync():
pass
# Run with: pytest --with-integration --with-slow-integration
Requires pytest to be installed; designed for Python 3.6+.
Verify before relying
- Whether the plugin works reliably with recent pytest versions (last tested in 2023).
- Compatibility with modern pytest-cov versions and whether coverage exclusion still functions as documented.
- Behavior under xdist with current pytest-xdist releases and whether the documented limitation still applies.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,366 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 273,440/month — #8,200 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_integration-0.2.3-py3-none-any.whl
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-fail-slowA pytest plugin that marks tests as failed if…
permissive · top 15,000 on PyPI
pytest-describeA pytest plugin that organizes tests into…
permissive · top 5,000 on PyPI
pytest-skip-markersA pytest plugin that provides skip markers to…
permissive · top 15,000 on PyPI
pytest-orderA pytest plugin that lets you control the order…
permissive · top 5,000 on PyPI
pytest-dependencyA pytest plugin that marks tests as dependent…
permissive · top 5,000 on PyPI
pytest-coverpytest-cover is a pytest plugin for measuring…
permissive · top 15,000 on PyPI
pytest-mpiA pytest plugin that marks and runs tests under…
permissive · top 15,000 on PyPI
pytest-orderingA pytest plugin that lets you control the…
permissive · top 5,000 on PyPI
pytest-covA pytest plugin that measures code coverage…
permissive · top 1,000 on PyPI
pytest-incrementalpytest-incremental is a pytest plugin that…
permissive · top 15,000 on PyPI