Run mutate-changes in-process in its tests, so mutmut sees the code they reach, and kill the mutants of mutmut_setup and mutmut_mutants that change behaviour

This commit is contained in:
2026-11-11 19:39:40 +01:00
parent 8f253dae3b
commit aa777819e8
2 changed files with 45 additions and 8 deletions
+1 -1
View File
@@ -78,4 +78,4 @@ def defined(tree: ast.Module, key: str) -> ast.AsyncFunctionDef | ast.FunctionDe
def as_named(lines: list[str], function: ast.AsyncFunctionDef | ast.FunctionDef, name: str) -> list[str]:
"""A function's lines from its def, decorators left out, with the def naming it name."""
spanned = lines[function.lineno - 1:function.end_lineno]
return [spanned[0].replace(function.name, name, 1), *spanned[1:]] if spanned else []
return [spanned[0].replace(function.name, name), *spanned[1:]]