Fast-first mutation testing for pytest. Let the gremlins loose, see which ones survive.
Actively maintained. Last release 4 days ago, commits in 13 of the last 26 weeks. A safe choice.
pip install pytest-gremlinspytest-gremlins
Fast-first mutation testing for pytest. Speed that makes mutation testing practical for everyday TDD.
Let the gremlins loose. See which ones survive.
Key Features
- Speed-First Architecture - Mutation switching eliminates file I/O and module reloads. Run gremlins in seconds, not hours.
- Native pytest Integration - Zero configuration to start. Just add
--gremlinsto your pytest command. - Coverage-Guided Selection - Only runs tests that actually cover the mutated code. 10-100x fewer test executions in well-modularized codebases.
- Incremental Caching - Results cached by content hash. Unchanged code skips re-testing entirely.
- Parallel Execution - Distribute gremlins across CPU cores for linear speedup.
Quick Start
# Install
pip install pytest-gremlins
# Run mutation testing
pytest --gremlins
That's it. pytest-gremlins will instrument your code, release the gremlins, and report which ones your tests zapped (good!) and which survived (test gaps!).
Why pytest-gremlins?
Code coverage lies. It tells you what code your tests execute, but not whether your tests would catch bugs.