Skip to main content

No project description provided

Project description

Mutmut is a mutation testing library/tool. It aims to be usable as a program directly, but also to have an easy to use API.

Install

pip install mutmut

Usage

mutmut path/to/directory/you/want/to/mutate

This will by default run py.test on tests in the “tests” folder. Run

mutmut --help

for the available flags to use other runners, etc.

The output of the mutation tests (if you have surviving mutants) looks like:

FAILED: mutmut path/filename.py --mutation 10 --apply

I’ve made is to you can just copy paste everything after “FAILED:” and run it directly and you’ll get the mutant on disk. You should REALLY have the file you mutate under source code control and committed before you mutate it!

You should start from the bottom of the list, because if you start from the top, the indexes of the mutations change.

You can mark lines like this:

some_code_here()  # pragma: no mutate

to stop mutation on those lines. Some cases we’ve found where you need to whitelist lines are:

  • The version string on your library. You really shouldn’t have a test for this :P

  • Optimizing break instead of continue. The code runs fine when mutating break to continue, but it’s slower.

Future plan

  • Custom importer that will mutate the code on the way in

  • Plug in to py.test (and nose, etc?) to make it use the importer

  • Optimization: Keep a cache of hashes to know which files have changed since they were tested, so we can skip testing files which are already done

  • Optimization: Use testmon to know which tests to rerun for each mutation

  • Speed up: Make the runner itself a part of py.test so we can use py.test test parallelization/distribution

Changelog

0.0.1 (2016-12-01)

  • Initial version

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

mutmut-0.0.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

mutmut-0.0.2-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mutmut-0.0.2.tar.gz.

File metadata

  • Download URL: mutmut-0.0.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mutmut-0.0.2.tar.gz
Algorithm Hash digest
SHA256 cdfa4f07e23d05be9ab25f5fcd6539429a50973d13a46847146fd4ebafe046e6
MD5 b6ee2708ddf36e09b9cc7a8c42697748
BLAKE2b-256 e2e6d168cb140c68b4ddd64fc658d1abd17c2f10872752561d927050a6aa21b2

See more details on using hashes here.

File details

Details for the file mutmut-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mutmut-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8e600787505770760d0598c77b733c0531ed3ca0b5502ed5e1bb66071ba8c30b
MD5 5edd5d74beff74308a3a47dc7cb434e5
BLAKE2b-256 8a2632382bbc3b2340a120eb7e41a13fce0a769591b52cd5e1f1ccbbb107d6fb

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