Skip to main content

mutatest2: A fork of mutatest for python mutation testing

Python versions License PyPI version PyPI status PyPI Format PyPI Downloads

Are you confident in your tests? Try out mutatest2 (or the original mutatest if using older python versions) and see if your tests will detect small modifications (mutations) in the code. Surviving mutations represent subtle changes that are undetectable by your tests. These mutants are potential modifications in source code that continuous integration checks would miss.

For detailed documentation, refer to the upstream project’s docsite.

Story of the Fork

This package is essentially just mutatest with updated tooling, dropping the support of older python versions and adding support for newer python versions (v3.11 and above). All the good ideas in this repository originated from Evan Kepner. Please take a look at the upstream package and its documentation site for details.

I merely wanted to use the package with some of my more modern python code. The upstream project breaks on newer python version and has not seen an update in 3 years. Given that the project was licensed under MIT license, I created this fork and made the updates I wanted to see.

I am not sure how long I will maintain this project and I am not accepting active contributions to it. If you like the changes I have made, feel free to use this package or to pull the changes up to the parent package and make a PR against it. Or fork it again like me; mutations are the name of the game!

Features

  • Simple command line tool with multiple configuration options.

  • Built on Python’s Abstract Syntax Tree (AST) grammar to ensure mutants are valid.

  • No source code modification, only the __pycache__ is changed.

  • Uses coverage to create only meaningful mutants.

  • Built for efficiency with multiple running modes and random sampling of mutation targets.

  • Capable of running parallel mutation trials with multiprocessing.

  • Flexible enough to run on a whole package or a single file.

  • Includes an API for custom mutation controls.

  • Tested on Linux. Relies on the upstream project’s tests on Windows, and MacOS.

  • Full strict static type annotations throughout the source code and the API.

Install

Install from PyPI:

$ pip install mutatest2

Example Output

See upstream documentation site.

Documentation

For full documentation, including installation, CLI references, API references, and tutorials, please see https://mutatest.readthedocs.io/en/latest/. The upstream project is hosted on PyPI at https://pypi.org/project/mutatest/.

This downstream fork is hosted on PyPI at https://pypi.org/project/mutatest2/.

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features. I am currently not accepting code contributions to this project. See the Contributing Guidelines if you are interested in submitting code in the form of pull requests to the upstream project.

ChangeLog

Consult the Changelog page for fixes and enhancements of each version.

License

Original copyright Evan Kepner 2018-2020. Copyright for the new code added as part of this fork belongs to Vaibhav Karve 2026-2027.

Distributed under the terms of the MIT license, mutatest is free and open source software, so is mutatest2.

Metadata

Release files for mutatest2 4.0.1

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

Source distribution (sdist)

Source distribution for mutatest2 4.0.1
File Size Uploaded Provenance Actions
mutatest2-4.0.1.tar.gz 81.8 kB Without provenance Details for mutatest2-4.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mutatest2 4.0.1
File Interpreter ABI Platform Actions
mutatest2-4.0.1-py311-none-any.whl Python 3.11 none any Details for mutatest2-4.0.1-py311-none-any.whl

Total release size: 143.0 kB

Release files / mutatest2-4.0.1.tar.gz

Download URL mutatest2-4.0.1.tar.gz
Size 81.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6007b2c3be291ae111c9674df320346b14a5ecfcbe2b42be6d5a41fb7f5c949d
BLAKE2b-256 checksum
How to use checksums
5c2cd14603e787264a69b16faf95209bd8a56493007cbd6a0effa5c3e7cf3cbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mutatest2-4.0.1-py311-none-any.whl

Download URL mutatest2-4.0.1-py311-none-any.whl
Size 61.2 kB
Tags Python 3.11
SHA-256 checksum
How to use checksums
4e14f8292314e9bed6603266ca5accad5fd6734d7010c7dee3a6d112e3694eee
BLAKE2b-256 checksum
How to use checksums
f6974773fa9ef0d7d8aaadbc18f86f8b6d274e9872ee916e9c2cc88b156fc0da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mutatest2 4.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files No provenance

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