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.
Metadata
Release files for pytest-spark-mutation-testing 1.0.1
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 | Actions Reset |
|---|---|---|---|---|
| pytest_spark_mutation_testing-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pytest_spark_mutation_testing-1.0.1-py3-none-any.whl |
Release files / pytest_spark_mutation_testing-1.0.1-py3-none-any.whl
| Download URL | pytest_spark_mutation_testing-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d543b776a26d6aa5163f77cbee95315385d460b65bb0a09fa013853943fb7e1a
|
|
BLAKE2b-256 checksum How to use checksums |
b0dfb6d2f29aa32831d1486440a15121100c7d6ae4ae1dffba5a153e6cba3bb8
|
| 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 25, 2026.
Transparency logSecurity for pytest-spark-mutation-testing 1.0.1
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.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for pytest_spark_mutation_testing-1.0.1-py3-none-any.whl
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 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.