Registry / testing / pytest-cagoule

pytest-cagoule

JSON →
library0.4.0pypypi✓ verified 88d ago

pytest-cagoule is a pytest plugin that only runs tests affected by code changes, using static analysis to determine test dependencies. Current version 0.4.0 is in maintenance mode; no recent releases since 2021. It works by analyzing import graphs and git diff.

pip install pytest-cagoule
INSTALL
IMPORT
SIG · PYTEST-CAGOULE
P
pytest-cagoule
testingpythonv0.4.0
Install
4.3s avg
Import
—
Disk
32MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 33.6MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 0.000s · 34MB
32MB installed
● package 32MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest_cagoule
✓ import pytest_cagoule
Plugin auto-registers via conftest; manual import not required

Run pytest with the --cagoule flag to only execute tests affected by changes compared to the base branch (default 'master').

# No configuration needed. Run pytest with --cagoule # pytest --cagoule # To specify a base branch: # pytest --cagoule --base-branch=main
Debug
Known issues
deprecatedpytest-cagoule is no longer actively maintained. Consider using pytest-testmon or pytest-watch as alternatives.
fix
Switch to pytest-testmon (pip install pytest-testmon) and use --testmon flag.
affects: >=0.4.0
gotchaThe default base branch is 'master', which may not match your repository's default branch (e.g., 'main'). Tests may not run correctly if the branch name is wrong.
fix
Use --base-branch=main explicitly if your primary branch is 'main'.
affects: all
gotchaThe plugin only analyzes import dependencies; it does not detect changes in non-imported files or dynamic imports. Tests affecting configuration files or data may be missed.
fix
Manually include tests for changed configuration or data files.
affects: all
breakingRequires a git repository and may fail if run outside a git working directory.
fix
Ensure pytest is run inside a git repository with a valid git diff.
affects: all
Errors
Common errors & fixes
pytest: error: unrecognized arguments: --cagoule
pytest-cagoule is not installed or not registered as a plugin.
fix
Reinstall: pip install pytest-cagoule. Ensure no typos in the flag.
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
The default base branch 'master' does not exist; repository uses 'main' or another name.
fix
Use --base-branch=main or the correct branch name.
ModuleNotFoundError: No module named 'git'
GitPython dependency is missing.
fix
Install GitPython: pip install GitPython
Upgrade
Version history
0.4.0latest on PyPI · released Jan 1, 2020
Audit
Dependencies
pytestrequiredRequired plugin dependency
gitpythonrequiredUsed for git diff analysis
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
pytest-cagoule — pip install pytest-cagoule · libregistry