mutation.ScoreReport(unit, evaluations, baseline_passed, results)
Mutation score of one unit.
Attributes
| unit |
str |
Dotted module name. |
| evaluations |
tuple[str, …] |
The evaluation files that were run. |
| baseline_passed |
int |
Evaluations that pass on the unchanged module. |
| results |
tuple[MutantResult, …] |
One result per mutant, in source order. |
Examples
from spotregen.mutation import MutantResult, ScoreReport, generate_mutants
mutants = generate_mutants("def f(x):\n return x + 1\n")
results = (MutantResult(mutants[0], True, "1 failed"),
MutantResult(mutants[1], False, "survived"))
report = ScoreReport("pkg.f", ("tests/test_f.py",), 1, results)
print(report.killed, report.planted, report.score)