Mutation testing for Python with an embedded-in-source manifest
Project description
mutate4py
Mutation testing for Python. Discovers mutation sites, applies each one, runs your tests, and reports killed, survived, and uncovered mutations — with an embedded-in-source manifest so differential reruns survive a clone with zero CI setup.
A faithful Python port of unclebob/mutate4go,
with the user-facing contract cross-checked against
unclebob/clj-mutate. Where Python forces a
divergence (coverage acquisition, the manifest hash) it is marked [PY] and
justified in docs/spec.md.
Install
uvx mutate4py # run without installing
uv tool install mutate4py
Usage
mutate4py path/to/file.py --test-command "pytest" --lcov lcov.info
Generate lcov.info with coverage.py:
pytest --cov --cov-branch --cov-report=lcov:lcov.info
See mutate4py --help and the spec for the full flag set.
How it differs from mutate4go ([PY])
--max-workersuses clone-per-worker, not tree-copy+cwd— mutate4go's tree-copy model is unsound under Python editable installs (pip install -e .), so each worker gets its ownuv-provisioned venv instead.- Coverage is acquired explicitly —
--lcov/--cov-cmd/--reuse-coverage(Python has no universal-coverprofileequivalent). - Manifest hash is structural (
ast.dump()), so reformatting and comment edits don't trigger a re-test, but any behavior-affecting edit does. - Operators are localized to Python: adds
and/or,True/False, and the identity/membership negation flipsis/is notandin/not in.
Develop
Python ≥ 3.10, stdlib ast (zero runtime deps), packaged with hatchling.
uv sync
uv run mutate4py --help
uv run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mutate4py-0.1.0.tar.gz.
File metadata
- Download URL: mutate4py-0.1.0.tar.gz
- Upload date:
- Size: 301.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b615b1a8fc82044d8eb1294b19c09c75ba4ecd1600e5823a2c23e3000281e67
|
|
| MD5 |
721eaaa9d2295582fcfd92e78693211c
|
|
| BLAKE2b-256 |
bd523e3da60d123f7095e78b0a7810dd63d48b90116e47ca7b928f801506d12b
|
Provenance
The following attestation bundles were made for mutate4py-0.1.0.tar.gz:
Publisher:
release.yml on gabadi/mutate4py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mutate4py-0.1.0.tar.gz -
Subject digest:
8b615b1a8fc82044d8eb1294b19c09c75ba4ecd1600e5823a2c23e3000281e67 - Sigstore transparency entry: 2047648818
- Sigstore integration time:
-
Permalink:
gabadi/mutate4py@9093514b2c5c7818c9dc703130894aecbc67cd1c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gabadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9093514b2c5c7818c9dc703130894aecbc67cd1c -
Trigger Event:
push
-
Statement type:
File details
Details for the file mutate4py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mutate4py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b799ef7b693be8ec616df3f2ea652766f37a052c4b1de63e25e82c3a2c04b00
|
|
| MD5 |
bf960575674329c3969eeabca72d39b2
|
|
| BLAKE2b-256 |
6ae1328aa112002e069c34ad4c814adb83d073511fe7c47f6f6d736696fd02b1
|
Provenance
The following attestation bundles were made for mutate4py-0.1.0-py3-none-any.whl:
Publisher:
release.yml on gabadi/mutate4py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mutate4py-0.1.0-py3-none-any.whl -
Subject digest:
7b799ef7b693be8ec616df3f2ea652766f37a052c4b1de63e25e82c3a2c04b00 - Sigstore transparency entry: 2047648830
- Sigstore integration time:
-
Permalink:
gabadi/mutate4py@9093514b2c5c7818c9dc703130894aecbc67cd1c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gabadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9093514b2c5c7818c9dc703130894aecbc67cd1c -
Trigger Event:
push
-
Statement type: