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.0.tar.gz (83.4 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.0-py311-none-any.whl (61.2 kB view details)

Uploaded Python 3.11

File details

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

File metadata

  • Download URL: mutatest2-4.0.0.tar.gz
  • Upload date:
  • Size: 83.4 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.0.tar.gz
Algorithm Hash digest
SHA256 a303b27bc11e3f378bc17beabc960274ff37f36a55dee66b85b38dfd144f94cc
MD5 c9c9df3c822212d91de332425b1c3426
BLAKE2b-256 f186f72005ed9f61535213c7dbb091e8f819749f1503d60c44d46ebbf5e6c0f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mutatest2-4.0.0-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.0-py311-none-any.whl
Algorithm Hash digest
SHA256 2e810325581dcd893de02693f957f1735b525824b31710af9cc2c2451be154ce
MD5 766e5a703b4a92f640559fd4579f01f9
BLAKE2b-256 ca16b5825ee3a6325848583522a709b691b62f08c5a84eef0ebbaf8b3635b75a

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