Registry / testing / skippy-cov

skippy-cov

JSON →
library0.2.2pypypiunverified

Skippy-cov is a pytest plugin that intelligently selects and runs only relevant tests based on the current Git diff and previously collected coverage data. It aims to speed up CI/CD pipelines by avoiding unnecessary test runs by analyzing which code changes affect which tests. The current version is 0.2.2, with releases occurring periodically to refine its Git and pytest integration.

pip install skippy-cov
INSTALL
IMPORT
SIG · SKIPPY-COV
S
skippy-cov
testingpythonv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to install skippy-cov, set up a minimal Git repository with a module and tests, run `pytest` to collect initial coverage data, then simulate code changes on a feature branch, and finally use `skippy-cov` with a Git diff to run only the affected tests.

mkdir my_skippy_project && cd my_skippy_project git init -b main pip install skippy-cov pytest coverage # Create a simple module and test file mkdir src && mkdir src/tests echo "def func_a():\n return 'A'\ndef func_b():\n return 'B'" > src/my_module.py echo "import pytest\nfrom src.my_module import func_a, func_b\n\ndef test_func_a():\n assert func_a() == 'A'\n\ndef test_func_b():\n assert func_b() == 'B'" > src/tests/test_my_module.py touch src/__init__.py src/tests/__init__.py git add . git commit -m "Initial code and tests" echo "\n--- First run: Collect all coverage data ---" pytest --skippy-cov --cov=src --cov-report=xml src/tests/ # Simulate a change to func_a and add a new test on a feature branch git checkout -b feature/new-func echo "def func_a():\n return 'A_modified'\ndef func_b():\n return 'B'\ndef func_c():\n return 'C'" > src/my_module.py echo "import pytest\nfrom src.my_module import func_a, func_b, func_c\n\ndef test_func_a():\n assert func_a() == 'A_modified'\n\ndef test_func_func_b():\n assert func_b() == 'B'\n\ndef test_func_c():\n assert func_c() == 'C'" > src/tests/test_my_module.py git add . git commit -m "Add func_c and modify func_a" echo "\n--- Second run: Run only affected tests using diff ---" # Generate a diff between 'main' branch and current 'feature/new-func' branch git diff main...feature/new-func -- src/my_module.py > /tmp/my_skippy_diff.diff pytest --skippy-cov=/tmp/my_skippy_diff.diff src/tests/ echo "Expected: Only tests related to func_a (modified) and func_c (new) should run."
Debug
Known issues
gotchaSkippy-cov requires the project to be a properly initialized Git repository. It relies heavily on Git commands for diffing and file tracking.
fix
Ensure you run `git init` in your project root before using skippy-cov, and make sure your changes are committed or staged for diffing.
affects: All versions
gotchaSkippy-cov is a pytest plugin and depends on `pytest` and `coverage.py` being installed in the same environment. Without them, it cannot function correctly.
fix
Install all necessary packages: `pip install skippy-cov pytest coverage`.
affects: All versions
breakingIn version 0.2.0, skippy-cov changed its pytest integration strategy from `pytest_collection_modifyitems` to `pytest_configure`. This might affect users with highly customized pytest plugins that interact with collection hooks.
fix
Review your custom pytest plugins for compatibility. Most standard usage should be unaffected, but complex collection modifications might need adjustment.
affects: >=0.2.0
gotchaWhen using `--skippy-cov` with a diff, it expects a path to a file containing the `git diff` output, not the diff output itself directly or a branch name.
fix
Generate the diff into a temporary file first: `git diff main...HEAD -- path/to/file.py > /tmp/my_diff.diff`, then pass the path to the `--skippy-cov` flag: `pytest --skippy-cov=/tmp/my_diff.diff`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'skippy_cov'
The skippy-cov package is not installed in your current Python environment.
fix
Run `pip install skippy-cov`.
pytest: error: unrecognized arguments: --skippy-cov
The `skippy-cov` plugin is not being detected by `pytest`. This can happen if it's not installed, there's a version mismatch, or another plugin is interfering.
fix
Ensure `skippy-cov` and `pytest` are installed and up-to-date: `pip install --upgrade skippy-cov pytest`. Verify `pytest --version` shows skippy-cov as a plugin.
Fatal: not a git repository (or any of the parent directories): .git
Skippy-cov was executed in a directory that is not part of a Git repository. It requires Git for its core functionality.
fix
Initialize a Git repository by running `git init` in your project's root directory or navigate to an existing Git repository.
FileNotFoundError: [Errno 2] No such file or directory: 'git'
The Git executable is not found in your system's PATH. Skippy-cov directly invokes Git commands.
fix
Install Git on your system and ensure it's accessible from your command line. For Linux: `sudo apt-get install git`, for macOS: `brew install git`, for Windows: download from git-scm.com.
Upgrade
Version history
0.2.2latest on PyPI · released Jun 4, 2025
Audit
Dependencies
pytestrequiredCore test runner integration for the plugin
coveragerequiredCoverage data collection and analysis
GitPythonrequiredPythonic interface to Git repositories
Agent activity
2 hits · last 30 days
node
2
Resources
skippy-cov — pip install skippy-cov · libregistry