Skip to content

v0.2.0 — 5 New Mutation Operators

Choose a tag to compare

@markng markng released this 19 Feb 23:23
· 32 commits to main since this release

What's New

Five new mutation operator families, expanding pytest-leela's mutation coverage:

Bitwise Operators

  • BitAnd (&), BitOr (|), BitXor (^), LShift (<<), RShift (>>)
  • Includes type-aware pruning for int/bool operands

Augmented Assignments

  • All 12 augmented assignment operators (+=, -=, *=, /=, //=, %=, **=, &=, |=, ^=, <<=, >>=)
  • Mutations swap between compatible operator families

Inline Conditionals (Ternary)

  • x if cond else y → y if cond else x (swap branches)
  • x if cond else y → x (remove else)
  • x if cond else y → y (remove if)

Break/Continue Swaps

  • break → continue and continue → break inside loops

Exception Handler Mutations

  • Broad exception handlers (except Exception) → narrow (except RuntimeError)
  • Narrow handlers → broad handlers
  • Equivalent mutant detection for single-exception handlers

Stats

  • 386 tests passing
  • Full self-mutation coverage
  • Validated on real Django project (roaming-panda: 98.5%+ kill rate)