Answer prose round 1: 0 🔴, 6 🟡 (0 misread); docstrings and a fixture's comment say what the code does
CI / tests (pull_request) Has been cancelled

This commit is contained in:
2026-11-23 22:31:03 +01:00
parent fe6d119183
commit 2aa7b7399a
6 changed files with 20 additions and 15 deletions
+4 -3
View File
@@ -9,8 +9,9 @@ HUNK = re.compile(r"^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@", re.MULTILINE)
class Mutant(typing.NamedTuple):
"""A mutant the project's tests killed, as the lines it changes in the tree its tool ran in: the number of the first, from 1,
those lines as the tree has them, and what the mutant has in their place. name is what the report calls the bug it becomes:
the path and line, then the tool's own name of the mutant."""
those lines as the tree has them, and what the mutant has in their place. Where it only adds lines, the number is that of the
line they go in before. name is what the report calls the bug it becomes: the path and line, then what the tool tells the
mutant by, which is Gremlins' column and mutator, or mutmut's name."""
path: str
line: int
@@ -20,7 +21,7 @@ class Mutant(typing.NamedTuple):
def mutated(source: bytes, mutant: Mutant) -> bytes | None:
"""A file's source with the mutant applied, or None where its line doesn't start the lines the mutant changes."""
"""A file's source with the mutant applied, or None where the lines the mutant changes don't stand at the mutant's line."""
lines = source.split(b"\n")
first = mutant.line - 1
if not 0 <= first <= len(lines) or tuple(lines[first:first + len(mutant.was)]) != mutant.was: