Skip to main content

Fork of mutatest. Python mutation testing: test your tests!

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mutatest2-4.0.1.tar.gz (81.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mutatest2-4.0.1-py311-none-any.whl (61.2 kB view details)

Uploaded Python 3.11

File details

Details for the file mutatest2-4.0.1.tar.gz.

File metadata

  • Download URL: mutatest2-4.0.1.tar.gz
  • Upload date:
  • Size: 81.8 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for mutatest2-4.0.1.tar.gz
Algorithm Hash digest
SHA256 6007b2c3be291ae111c9674df320346b14a5ecfcbe2b42be6d5a41fb7f5c949d
MD5 ead390943199387ed306b5f263b6e44b
BLAKE2b-256 5c2cd14603e787264a69b16faf95209bd8a56493007cbd6a0effa5c3e7cf3cbf

See more details on using hashes here.

File details

Details for the file mutatest2-4.0.1-py311-none-any.whl.

File metadata

  • Download URL: mutatest2-4.0.1-py311-none-any.whl
  • Upload date:
  • Size: 61.2 kB
  • Tags: Python 3.11
  • Uploaded using 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}

File hashes

Hashes for mutatest2-4.0.1-py311-none-any.whl
Algorithm Hash digest
SHA256 4e14f8292314e9bed6603266ca5accad5fd6734d7010c7dee3a6d112e3694eee
MD5 7d6bace2a9f50b246c80b917c8e991d9
BLAKE2b-256 f6974773fa9ef0d7d8aaadbc18f86f8b6d274e9872ee916e9c2cc88b156fc0da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page