Skip to content

v0.4.0

Choose a tag to compare

@markng markng released this 05 Apr 02:34
· 20 commits to main since this release

What's New

Per-Mutant Timeout

Control-flow mutations (break→continue, and→or in loops) can create infinite loops. Leela now sets an automatic timeout per mutant based on test execution times from the coverage pass:

  • Timeout = max(2 × expected time + 1s, 5s)
  • Timed-out mutants are marked as killed with killing_test="<timeout>"
  • Cross-platform via threading.Timer

Bytecode Mutation Engine (Python 3.14+)

For BinOp, Compare, AugAssign, and UnaryOp mutations (~60% of all mutants), leela now patches compiled bytecode directly instead of going through ast.parse → visit → compile:

  • Compile source once, produce mutant code objects via single-byte patches
  • Dynamic opcode tables (portable across Python versions)
  • Falls back to AST pipeline for complex mutations and Python < 3.14
  • On Python 3.13 and below, all mutations use the AST pipeline (no behavior change)

Install / Upgrade

pip install pytest-leela==0.4.0