pytest-spark-mutation-testing
Semantic mutation testing for PySpark pipelines — a pytest plugin that mutates Catalyst plans (joins, filters, aggregates, windows, projections) and scores whether your test suite catches them.
Install
pip install pytest-spark-mutation-testing
Requires Python 3.9+ and PySpark 3.5.x or 4.2.x (4.2 is Scala 2.13-only).
Quick start
cd your-pipeline
pytest --spark-mutate
The plugin runs your suite once unmutated (baseline), discovers every mutation site in the analyzed plans, then re-runs only the affected tests per mutant — fail-fast — and writes:
mutation-report.{json,sarif,html}— per-mutant verdicts (KILLED/SURVIVED/TIMED_OUT/NOT_APPLIED/ERRORED) and the mutation scoretest-value-report.{json,html}— per-test kill attribution that flags redundant test cases
Optional config in your pyproject.toml:
[tool.spark-mutator]
target_modules = ["my_pipeline.transforms"] # scope discovery
excluded_mutators = ["CrossJoinMutator"] # skip a rule
timeout_multiplier = 2.0 # per-mutant deadline
min_mutation_score = 80.0 # CI gate
Documentation
- Full developer guide
- PySpark quick start
- Runnable proof:
examples/pyspark-pipeline/(weak suite ⇒ mutants survive; hardened suite ⇒ mutants killed)
License
Apache-2.0 — see LICENSE.
Release files for pytest-spark-mutation-testing 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_spark_mutation_testing-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / pytest_spark_mutation_testing-1.0.0-py3-none-any.whl
| Download URL | pytest_spark_mutation_testing-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87e8587b4275953993dd71e55299f2c9f6229aac6b7c739844833db0ecccf1cb
|
|
BLAKE2b-256 checksum How to use checksums |
855a2450e34c05f431dabc665d6be2be1280ac36ff497f991387066089f7841a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency log