mutation.score_toml

mutation.score_toml(report)

The full result as TOML, one [[mutant]] table per mutant, for archiving.

Parameters

Name Type Description Default
report ScoreReport The result of mutation_score. required

Returns

Name Type Description
str str TOML text with unit, the spotregen version, evaluations, baseline_passed, planted, killed and the mutants.

Examples

import tomllib

from spotregen.mutation import (
    MutantResult, ScoreReport, generate_mutants, score_toml,
)

mutants = generate_mutants("X = 1\n")
report = ScoreReport("pkg.x", ("t.py",), 1, (MutantResult(mutants[0], True, "1 failed"),))
print(tomllib.loads(score_toml(report))["killed"])
1