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-cagouleVerified import paths — ran on the pinned version, not inferred.
Run pytest with the --cagoule flag to only execute tests affected by changes compared to the base branch (default 'master').
Switch to pytest-testmon (pip install pytest-testmon) and use --testmon flag.
Use --base-branch=main explicitly if your primary branch is 'main'.
Manually include tests for changed configuration or data files.
Ensure pytest is run inside a git repository with a valid git diff.
Reinstall: pip install pytest-cagoule. Ensure no typos in the flag.
Use --base-branch=main or the correct branch name.
Install GitPython: pip install GitPython