{"id":21799,"library":"pytest-cagoule","title":"pytest-cagoule","description":"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.","status":"maintenance","version":"0.4.0","language":"python","source_language":"en","source_url":"https://github.com/davidszotten/pytest-cagoule","tags":["pytest","plugin","test-selection","git"],"install":[{"cmd":"pip install pytest-cagoule","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required plugin dependency","package":"pytest","optional":false},{"reason":"Used for git diff analysis","package":"gitpython","optional":false}],"imports":[{"note":"Plugin auto-registers via conftest; manual import not required","wrong":"","symbol":"pytest_cagoule","correct":"import pytest_cagoule"}],"quickstart":{"code":"# No configuration needed. Run pytest with --cagoule\n# pytest --cagoule\n# To specify a base branch:\n# pytest --cagoule --base-branch=main","lang":"python","description":"Run pytest with the --cagoule flag to only execute tests affected by changes compared to the base branch (default 'master')."},"warnings":[{"fix":"Switch to pytest-testmon (pip install pytest-testmon) and use --testmon flag.","message":"pytest-cagoule is no longer actively maintained. Consider using pytest-testmon or pytest-watch as alternatives.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Use --base-branch=main explicitly if your primary branch is 'main'.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Manually include tests for changed configuration or data files.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure pytest is run inside a git repository with a valid git diff.","message":"Requires a git repository and may fail if run outside a git working directory.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Reinstall: pip install pytest-cagoule. Ensure no typos in the flag.","cause":"pytest-cagoule is not installed or not registered as a plugin.","error":"pytest: error: unrecognized arguments: --cagoule"},{"fix":"Use --base-branch=main or the correct branch name.","cause":"The default base branch 'master' does not exist; repository uses 'main' or another name.","error":"fatal: ambiguous argument 'master': unknown revision or path not in the working tree."},{"fix":"Install GitPython: pip install GitPython","cause":"GitPython dependency is missing.","error":"ModuleNotFoundError: No module named 'git'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}