Skip to main content

fest

An extremely fast mutation testing tool for Python.

PyPI License Rust Python


fest generates small changes (mutants) to your Python source code and checks whether your test suite catches them. Surviving mutants reveal gaps that line coverage alone cannot find.

Built in Rust with ruff's Python parser. ~25× faster than cosmic-ray on real-world projects (benchmark).

Highlights

  • 🔥 Parallel execution — runs mutants across all CPU cores simultaneously
  • 🎯 Coverage-guided — only runs tests that cover the mutated line, via per-test pytest-cov context
  • ⚡ In-process plugin — a persistent pytest worker pool avoids per-mutant startup overhead
  • 🧬 17 mutation operators — arithmetic, comparison, boolean, return value, constants, decorators, loops, and more
  • 📊 Multiple output formats — text, JSON, and self-contained HTML reports
  • 🔄 Session support — stop and resume long runs with SQLite-backed sessions

Installation

From PyPI (recommended)

pip install fest-mutate

From source

git clone https://github.com/sakost/fest.git
cd fest
cargo build --release

The binary will be at target/release/fest. Make sure pytest and pytest-cov are installed in the Python environment you want to test:

pip install pytest pytest-cov

Quick start

cd your-python-project
fest run

fest will:

  1. Discover Python source files matching src/**/*.py (configurable)
  2. Run pytest with coverage to build a per-test line map
  3. Generate mutants from the discovered source
  4. Test each mutant against only the relevant tests
  5. Print a summary report
fest — mutation testing for Python

  Configuration loaded (fest.toml)  0ms
  Mutator registry built (14 mutators)  0ms
  Source files discovered (14 files)  0ms
  Mutants generated (4290 mutants)  23ms
  Coverage collected  40ms
  Session opened (.fest-session.db)  0ms
  Test workers ready (24 workers)  994ms
  Mutants tested (4186 mutants)  4m 6s

  Mutation Score: 85.7%  |  Killed: 2401  Survived: 314  Timeout: 80  Errors: 8

Configuration

Create fest.toml in your project root (or add [tool.fest] to pyproject.toml):

[fest]
source = ["src/**/*.py"]
exclude = ["**/test_*.py", "**/conftest.py"]
timeout = 30
workers = 8                    # default: 75% of CPU cores
fail_under = 80.0              # exit 1 if score is below this
output = "text"                # "text", "json", or "html"
backend = "plugin"             # "plugin" or "subprocess"
session = ".fest-session.db"   # enable stop/resume

All fields are optional — fest picks sensible defaults.

CLI

fest run [OPTIONS]
Flag Description
-s, --source <GLOB> Source file patterns
-e, --exclude <GLOB> Exclude patterns
-w, --workers <N> Parallel test workers
-t, --timeout <SEC> Per-test timeout (default: 10)
--fail-under <SCORE> Minimum mutation score (0–100)
-o, --output <FMT> text · json · html
-b, --backend <BE> plugin (default) · subprocess
--coverage-from <PATH> Use existing .coverage file
--session <PATH> SQLite session for stop/resume
--reset Reset session before running
--incremental Only re-test changed files
--seed <N> Deterministic mutation seed
--filter-operators <PAT> Include/exclude operators by name
--filter-paths <GLOB> Restrict mutation to matching files
--progress <STYLE> auto · fancy · plain · verbose · quiet
-v, --verbose Per-mutant progress output

Mutation operators

Operator Example
arithmetic_op x + y → x - y
augmented_assign x += 1 → x -= 1
bitwise_op a & b → a | b
boolean_op a and b → a or b
break_continue break → continue
comparison_op a == b → a != b
constant_replace True → False, 0 → 1
exception_swallow raise Error() → pass
negate_condition if x: → if not x:
remove_decorator @cache → (removed)
remove_super super().__init__() → (removed)
return_value return val → return None
statement_deletion do_something() → pass
unary_op -x → x, ~x → x
variable_replace a = x → a = y (same-scope same-type)
variable_insert a = f(x) → a = f(y)
zero_iteration for x in items: → for x in []:

Backends

Backend How it works Speed Compatibility
plugin (default) Patches modules in a long-lived pytest process ⚡ Fast Most projects
subprocess Overwrites source file on disk, runs pytest Slower Universal

The plugin backend falls back to subprocess automatically on infrastructure errors.

Performance

On python-ecdsa (17k lines, 1,477 tests):

fest cosmic-ray
Throughput 17.4 mut/s 0.7 mut/s
Time to complete 4 min ~6 hours (estimated)
Speedup ~25× baseline

See the full benchmark report for methodology and reproduction steps.

License

Dual-licensed under MIT or Apache-2.0, at your option.

Metadata

Release files for fest-mutate 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for fest-mutate 0.1.3
File
fest_mutate-0.1.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
fest_mutate-0.1.3-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details
fest_mutate-0.1.3-py3-none-manylinux_2_39_aarch64.whl Python 3 none Linux glibc 2.39+ ARM64 Details
fest_mutate-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details
fest_mutate-0.1.3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
fest_mutate-0.1.3-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 18.0 MB

Release files / fest_mutate-0.1.3-py3-none-win_amd64.whl

Download URL fest_mutate-0.1.3-py3-none-win_amd64.whl
Size 2.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
98b68e7080485915f9c30f917d05af1b4a663eec9e47cf12b99b0a17a07627ea
BLAKE2b-256 checksum
How to use checksums
fbba818ab6c6741afdc7624c38a7e809fe67841577cab13f8baecbe0fdf1b8bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / fest_mutate-0.1.3-py3-none-manylinux_2_39_x86_64.whl

Download URL fest_mutate-0.1.3-py3-none-manylinux_2_39_x86_64.whl
Size 3.1 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
05d137c5e19146417f171846d0c3af522d734cf52db9d963ae8a8cca16944679
BLAKE2b-256 checksum
How to use checksums
07caff32e42a775c5f28684e4d7ee31ca344edca82de06b17540ed45c30fa44e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / fest_mutate-0.1.3-py3-none-manylinux_2_39_aarch64.whl

Download URL fest_mutate-0.1.3-py3-none-manylinux_2_39_aarch64.whl
Size 3.0 MB
Tags Linux glibc 2.39+ ARM64 Python 3
SHA-256 checksum
How to use checksums
78931d8aa80cc1eb4ec5cc66a91219f5d4eaff48ba9d3cdcd94002cef942981e
BLAKE2b-256 checksum
How to use checksums
7dc87eb55991496419d1fd7a309d1610c0b1a094b2967399bbea99686aa25178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / fest_mutate-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL fest_mutate-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 3.2 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d6e71b84b5c8fda7a7b7c22ff6d86cdbb49b4097c889b6ef393b1227588b0754
BLAKE2b-256 checksum
How to use checksums
955951ab024b4cd1b2ee61573c9417c1cd02a72574ebe18b7f737d19e9de9ecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / fest_mutate-0.1.3-py3-none-macosx_11_0_arm64.whl

Download URL fest_mutate-0.1.3-py3-none-macosx_11_0_arm64.whl
Size 2.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8d26d81149e4dff39a1ea0c1593e238a67d7952fcb6cf6f2cdc0d4219c736666
BLAKE2b-256 checksum
How to use checksums
12aa60f1de73f03aaf4e8cc6e822d6e82e54b072a8f645e5b5c009bc32a374a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / fest_mutate-0.1.3-py3-none-macosx_10_12_x86_64.whl

Download URL fest_mutate-0.1.3-py3-none-macosx_10_12_x86_64.whl
Size 3.0 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f538884b0c7ddd1260dbae9d0bf4fe221f5b62872fcd4cdec854701d3fd57615
BLAKE2b-256 checksum
How to use checksums
2ecc3645b68b0b8373a95f455c09c0a1bfa72d14937c977b2f7a5bc0de10c25f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

6 release files

0.1.2

6 release files

0.1.1

6 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page