pytest-cagoule
Pytest plugin to only run tests affected by changes
Decision gist · record as of 2026-08-14
No, not recommended for new projects. The package is abandoned (last release 2020-01-01, no maintenance since), has high install friction, and offers no guarantees of compatibility with modern pytest or coverage.py versions. While the core idea is sound, the lack of maintenance and unclear dependency requirements make it a poor choice. Consider actively maintained alternatives for test selection based on code coverage.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires pytest and coverage.py to be installed separately; the plugin only captures lines executed during individual test runs, excluding module-level code executed at import time.
- High install friction: the package is abandoned (last release 2020-01-01, no commits since), and no runtime dependencies are declared, suggesting it may require manual setup or external tools.
- Maintenance status is a significant concern for new projects.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or redistribution in your own projects.
last release 2020-01-01 (2417 days) · last repo commit 2020-01-01 · 7 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 127,047 downloads/mo, #11,755 on PyPI
Alternatives
Verify before relying
pip install pytest-cagoule
# Collect coverage with test contexts
pytest --cov --cov-context=test
# Run tests touching a specific file
pytest --cagoule-select=path/to/file.py
# Or use git diff to find changed files
pytest --diff- Whether the plugin works with current pytest and coverage.py versions (last release was 2020-01-01).
- Whether git integration (--diff flag) works reliably with modern git workflows.
- Performance impact when handling large test suites or many changed files.
What it is and what it does
pytest-cagoule is a pytest plugin that uses coverage data to map which tests exercise which lines of code, then lets you run only the tests affected by your recent changes. After an initial full test run with coverage collection (using --cov --cov-context=test), you can specify a file path or use git diff to automatically identify changed code, and the plugin will select and run only the tests that touch those lines.
The plugin is designed for CI workflows where you want to speed up feedback by skipping unaffected tests. It has no runtime dependencies and integrates directly with pytest's command-line interface. However, it only captures coverage for code executed during test runs themselves, not module-level imports, so some code paths may be missed. The package is in alpha status and has been unmaintained since 2020.
Use it for
- Speed up CI pipelines by running only tests affected by a pull request's changes.
- Identify which tests exercise a specific file you're debugging or refactoring.
- Validate that a change to a utility module doesn't break tests in dependent modules.
- Reduce local test cycle time during development by running only affected tests after code edits.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No, not recommended for new projects.
The package is abandoned (last release 2020-01-01, no maintenance since), has high install friction, and offers no guarantees of compatibility with modern pytest or coverage.py versions. While the core idea is sound, the lack of maintenance and unclear dependency requirements make it a poor choice. Consider actively maintained alternatives for test selection based on code coverage.
Install
pytest-cagoule on PyPI
Before you install
High install friction: the package is abandoned (last release 2020-01-01, no commits since), and no runtime dependencies are declared, suggesting it may require manual setup or external tools. Maintenance status is a significant concern for new projects.
Requires pytest and coverage.py to be installed separately; the plugin only captures lines executed during individual test runs, excluding module-level code executed at import time.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or redistribution in your own projects.
Quickstart
pip install pytest-cagoule
# Collect coverage with test contexts
pytest --cov --cov-context=test
# Run tests touching a specific file
pytest --cagoule-select=path/to/file.py
# Or use git diff to find changed files
pytest --diff
Verify before relying
- Whether the plugin works with current pytest and coverage.py versions (last release was 2020-01-01).
- Whether git integration (--diff flag) works reliably with modern git workflows.
- Performance impact when handling large test suites or many changed files.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Abandoned 2,417 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 127,047 / month, #11,755 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Topic :: Software Development :: Testing |
Evidence: pytest-cagoule-0.4.0.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “run only changed code tests”
- pytest-cagouleA pytest plugin that identifies which tests exercise code you've…
- pytest-pickedA pytest plugin that automatically runs only the tests related to…
- pytest-testmonA pytest plugin that automatically identifies and runs only the tests…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-cov · snob-lib · pytest-split-tests · pytest-catchlog · pytest-cache · diff-cover · pytest-test-groups · pytest-watch · pytest-cover · cov-core