pymute
github.com
- Free plan
- Linux
What pymute is
pymute is a free mutation testing tool for Python and pytest, written in Rust. It creates a temporary directory for each mutant and changes Python file text rather than operating on the abstract syntax tree. Pytest is the default test runner, and tox is also supported. Documented mutation types include mathematical operators, conjunctions, booleans, control flow, comparisons, and numbers. By default, pymute reports mutants that survive because tests pass; other output levels can show caught mutants or process output. Users can filter files with a module glob, choose tests and mutation types, set parallel thread count, and limit the number of mutants. The limit selects a random subset. Installation uses Cargo from crates.io or GitHub and requires Rust and Cargo. With pytest, tests should run from the project root in independent copies and test the local copy rather than an installed package. Tox creates a separate virtual environment and installs the package for each mutant, which the project says is considerably slower. Each parallel thread needs temporary disk space, and a run may fail if /tmp runs out. The repository identifies its license as Unlicense.
Who it suits
pymute suits Python developers who want mutation testing with pytest or tox and can install Rust and Cargo. It is also a fit for users who need to restrict tests, mutation types, files, or mutant counts.
Good to know, and what to watch
- Supports both pytest and tox.
- Offers six documented mutation categories.
- Users can select tests and restrict files.
- Parallel execution and mutant sampling are available.
- Installation requires Rust and Cargo.
- Parallel threads consume temporary disk space.
- Pytest runs must test local project copies.
- Tox is considerably slower because it sets up environments.
Plans
Every plan and priceFree/open-source
Free plan
The Club's review
Mutation testing asks whether a test suite catches deliberate changes to the code it is meant to protect. pymute brings that check to Python projects, with pytest or tox as the runner. Its free price and controls for narrowing a run are appealing, but installing Rust and accommodating temporary project copies are meaningful prerequisites.
Overview
pymute creates a separate temporary directory for each mutant and makes changes by editing Python file text rather than operating on an abstract syntax tree. That gives it a direct workflow for checking how tests respond to common code changes, though projects that expect tests to run only against an installed package may need a different setup.
By default, the report shows surviving mutants: changes that the tests allowed to pass. Other output levels can show caught mutants or underlying process output, useful when a concise gap-finding report is not enough context to understand a run.
Key features
Targeted runs
Documented mutation types include mathematical operators, conjunctions, booleans, control flow, comparisons, and numbers. The --modules option filters files by glob, and files named test_* or ending in *_test.py are excluded automatically. Users can also choose mutation types and tests, set the thread count, and cap the number of mutants. The README recommends selecting tests to iterate more quickly on particular modules.
The --max-mutants option samples a random subset. That can make a run more manageable, but a capped run checks only part of the available mutant set. Parallel execution can also shorten runs, with a practical cost: every thread uses temporary disk space, and a full /tmp directory can cause failure.
Runner tradeoffs
pytest is the default, but its project-layout constraint is important: tests need to run from the project root in independent copies and test the local copy, not an installed package. tox avoids that particular pattern by creating a virtual environment and installing the package for each mutant, but that setup makes it considerably slower. The choice is therefore less about a universally better runner than whether the project can accommodate pytest’s copy-based workflow or justify tox’s repeated environment setup.
Pricing
pymute is free and open source, with the Free and open-source plan at free. It is a straightforward fit for individual developers and teams able to install and maintain the tool themselves. Installation uses Cargo from crates.io or directly from GitHub and requires Rust and Cargo; there is no paid tier to trade setup effort for another plan.
Platforms
pymute supports Linux and targets Python projects. It supports pytest and tox, with pytest as the default runner. Rust and Cargo are required to install it.
Who it's for
pymute is best suited to Python developers who want mutation testing without a license fee, can work with Rust tooling, and can run tests against temporary project copies. Its module and test selection, mutation-type controls, sampling cap, and thread setting give maintainers ways to focus runs. It is a weaker fit for projects whose tests depend on an installed package under pytest, or for teams that cannot spare temporary disk space for parallel mutants.
Pros and cons
- Pros: Free and open source, with documented mutation types spanning operators, control flow, booleans, and numbers.
- Pros: Module, test, and mutation-type selection help focus runs; the mutant cap offers a random sample when a full run is too large.
- Pros: Surviving mutants are the default report, putting attention on changes the tests failed to catch.
- Cons: Installation requires Rust and Cargo, adding a toolchain prerequisite for Python projects.
- Cons: pytest requires tests to run from the project root in independent copies and target the local copy rather than an installed package.
- Cons: tox sets up and installs into a separate virtual environment for each mutant, making it considerably slower; parallel runs also consume temporary disk space.
Alternatives
Mutation Testing Tools is the broader directory for comparing options in this category.
- ArcMutate is worth considering for open-source projects that qualify for its free licenses, or for readers who want a freemium option with a free trial and broader platform support.
- LittleDarwin is a free, donation-supported Java mutation analysis framework for readers working in Java rather than Python.
- MuJava is a free, as-is option under the Apache license for readers who need its Linux, macOS, or Windows support.
- Mutant offers a free full-featured plan for public repositories and a paid commercial plan at $30 a month per developer for any number of repositories; it may suit readers evaluating those terms instead.
- Mutatest is another free, open-source option for readers seeking a tool that supports Linux, macOS, and Windows.
- MutPy is a free alternative for readers who want a self-hosted option.
- pytest-gremlins is a free, MIT-licensed Python package for readers using Python 3.11 or later.
- Stryker Dashboard is a free, open-source dashboard for readers looking for a web or API-based option.
Verdict
Choose pymute if you want a free way to check whether Python tests catch common mutations and your project can meet its Rust, pytest-copy, or tox setup requirements. Its focused controls and surviving-mutant reports make the purpose clear; look elsewhere if those runner constraints or the temporary-disk demands of parallel execution do not fit your workflow.
The verdict
pymute provides configurable mutation testing for Python projects, with pytest as its default runner. Its local-copy pytest requirement, Rust installation, and temporary-disk needs are important setup considerations.
What the maker publishes
- Configuration
- Users can restrict mutations by module glob, select tests, choose mutation types, set thread count, and cap the number of mutants. source
- Distribution
- The README says to install pymute using Cargo from crates.io or directly from GitHub, and requires Rust and Cargo. source
- How it works
- It creates a temporary directory for each mutant and inserts mutations by manipulating text in Python files rather than operating on the AST. source
- Installation
- The README says to install pymute with Cargo from crates.io or directly from GitHub, and requires Rust and Cargo. source
- License
- The repository identifies its license as Unlicense. source
- License
- The repository identifies its license as Unlicense. source
- Maker
- The GitHub profile identifies the maker as Leonard Sasse. source
- Maker
- The Cargo manifest names Leonard Sasse as the author. source
- Mutation approach
- It creates a temporary directory for each mutant and inserts mutations by editing Python file text rather than operating on the AST. source
- Mutation types
- The documented mutation types include math operators, conjunctions, booleans, control flow, comparison operators, and numbers. source
- Mutation types
- Its listed mutation types include math operators, conjunctions, booleans, control flow, comparison operators, and numbers. source
- Output
- By default, pymute displays mutants that survived because the tests passed; additional output levels show caught mutants or underlying process output. source
- Output
- By default, it displays mutants that tests missed, with optional caught and process output levels. source
- Parallelism
- The --num-threads option controls how many mutants run in parallel, and each thread uses temporary disk space. source
- Project layout constraint
- With pytest, the project’s tests need to run from the project root in independent copies and test the local copy rather than an installed package. source
- Purpose
- Pymute is a mutation testing tool for Python and pytest written in Rust. source
- Purpose
- Pymute is a mutation testing tool for Python and Pytest written in Rust. source
- Pytest requirement
- With pytest, tests should run from the project root in independent project copies and test the local copy rather than an installed package. source
- Resource use
- The README notes that each parallel thread needs temporary disk space and may fail if /tmp runs out of space. source
- Sampling
- The --max-mutants option runs a randomly sampled subset of mutants. source
- Scoping
- The --modules option filters files using a glob, and files named test_* or ending in *_test.py are automatically excluded. source
- Test runners
- Pymute supports pytest and tox as test runners, with pytest as the default. source
- Test runners
- It supports pytest as the default runner and tox as an alternative. source
- Test selection
- The --tests option runs selected tests, which the README recommends for quicker iteration on specific modules. source
Checked against the maker's pages on 8 Oct 2026.