Context
Mutation-testing run against main (b850e2fec11b1966d2b73670ae56b5eff195284e), mutmut 3.6.0, local run 2026-07-10: 1025 mutants, 151 killed, 235 survived, 639 no-tests.
This issue covers the run() subprocess wrapper in hooks/post-turn-quality-stop-hook.py: 25 survivors (23 real gaps, 2 equivalent mutants handled in the worklist).
Surviving mutants
hooks/post-turn-quality-stop-hook.py:153 — subprocess.run keyword mutations: text=True → None/False/removed, capture_output=True → None/False/removed, check=False → True (x_run__mutmut_3, 4, 8, 9, 12, 13, 14).
hooks/post-turn-quality-stop-hook.py:156 — Path(exc.filename or "") → or "XXXX" in the FileNotFoundError guard (x_run__mutmut_17).
hooks/post-turn-quality-stop-hook.py:159 and :163 — fallback CompletedProcess field mutations in both the FileNotFoundError and NotADirectoryError branches: args=cmd → None/removed, returncode=1 → 2/None/removed, stdout="" → "XXXX"/None/removed, stderr=str(exc) → None/str(None)/removed (x_run__mutmut_19–40, 16 survivors).
Analysis
The only direct tests of run() cover the missing-cwd path and assert just returncode and a substring of stderr. No test invokes run() against a real command, so the text/capture_output keywords mutate freely; and no test exercises the NotADirectoryError branch or asserts args/stdout on the fallback objects, so those field mutations survive. Two mutants are equivalent (check=False → None, and dropping check=False) and are recorded as category 2 in the worklist rather than here.
Suggested tests
- Run
run(["sh", "-c", "echo out; echo err >&2; exit 3"], tmp_path) and assert returncode == 3, stdout == "out\n", stderr == "err\n" as str (kills the text and capture_output mutants and check=True, which would raise).
- Exercise the
NotADirectoryError branch (use a file path as cwd) and assert the full fallback object: args == cmd, returncode == 1, stdout == "", and stderr (kills the field mutants at line 163).
- Extend the existing missing-cwd test to assert
result.args == cmd and result.stdout == "" (kills the field mutants at line 159).
- Low priority: patch
subprocess.run to raise a filename-less FileNotFoundError with cwd=Path(".") and assert the fallback is returned rather than re-raised (kills x_run__mutmut_17).
Full worklist: triage worklist.md; dataset SHA b850e2f.
Context
Mutation-testing run against
main(b850e2fec11b1966d2b73670ae56b5eff195284e), mutmut 3.6.0, local run 2026-07-10: 1025 mutants, 151 killed, 235 survived, 639 no-tests.This issue covers the
run()subprocess wrapper inhooks/post-turn-quality-stop-hook.py: 25 survivors (23 real gaps, 2 equivalent mutants handled in the worklist).Surviving mutants
hooks/post-turn-quality-stop-hook.py:153—subprocess.runkeyword mutations:text=True→None/False/removed,capture_output=True→None/False/removed,check=False→True(x_run__mutmut_3,4,8,9,12,13,14).hooks/post-turn-quality-stop-hook.py:156—Path(exc.filename or "")→or "XXXX"in theFileNotFoundErrorguard (x_run__mutmut_17).hooks/post-turn-quality-stop-hook.py:159and:163— fallbackCompletedProcessfield mutations in both theFileNotFoundErrorandNotADirectoryErrorbranches:args=cmd→None/removed,returncode=1→2/None/removed,stdout=""→"XXXX"/None/removed,stderr=str(exc)→None/str(None)/removed (x_run__mutmut_19–40, 16 survivors).Analysis
The only direct tests of
run()cover the missing-cwd path and assert justreturncodeand a substring ofstderr. No test invokesrun()against a real command, so thetext/capture_outputkeywords mutate freely; and no test exercises theNotADirectoryErrorbranch or assertsargs/stdouton the fallback objects, so those field mutations survive. Two mutants are equivalent (check=False→None, and droppingcheck=False) and are recorded as category 2 in the worklist rather than here.Suggested tests
run(["sh", "-c", "echo out; echo err >&2; exit 3"], tmp_path)and assertreturncode == 3,stdout == "out\n",stderr == "err\n"asstr(kills thetextandcapture_outputmutants andcheck=True, which would raise).NotADirectoryErrorbranch (use a file path ascwd) and assert the full fallback object:args == cmd,returncode == 1,stdout == "", andstderr(kills the field mutants at line 163).result.args == cmdandresult.stdout == ""(kills the field mutants at line 159).subprocess.runto raise a filename-lessFileNotFoundErrorwithcwd=Path(".")and assert the fallback is returned rather than re-raised (killsx_run__mutmut_17).Full worklist: triage
worklist.md; dataset SHAb850e2f.