You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix incorrect coverage for type annotations (Issue #69)
Python 3.14 introduced PEP 649 (deferred annotation evaluation), which
creates __annotate__ code objects that are never executed during normal
program flow. This caused slipcover to incorrectly report annotation
lines as missed.
Additionally, in Python < 3.14 where annotations are evaluated eagerly,
multi-line function signatures had their annotation continuation lines
(e.g., "b: int,") counted as executable code, leading to inconsistent
line counts between Python versions.
This fix:
- Skips __annotate__ code objects in Python 3.14+
- Detects and excludes annotation-only lines in Python < 3.14 by
identifying lines that only contain type-loading bytecode
- Filters executed lines to only count lines in code_lines
Fixes#69
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments