Commit d624e73
committed
test: replace if/else branch with single assert to satisfy 100% branch coverage
The prior if/else on sys.version_info created a branch where only one
side executes per CI job (each job pins a single Python version), so
coverage's --cov-branch --cov-fail-under=100 flags the always-taken
branch as partial on every job in the matrix (all failed on this PR's
last CI run). Collapsing to a single assert against a version-gated
tuple keeps the exact same behavioral pinning (PARSE_ERROR only below
3.14, either code on 3.14+) without introducing an untestable branch.
Verified locally on Python 3.10 (lowest supported): full suite passes
(5444 passed, 9 skipped, 1 xfailed), coverage report shows 100.00%
total including this file, ruff check and ruff format --check clean.
<sub>AI Disclosure: https://gist.github.com/maxisbey/6123d132484e4c533eab519a2800693d</sub>1 parent 1956ff6 commit d624e73
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
| 1033 | + | |
| 1034 | + | |
1037 | 1035 | | |
1038 | 1036 | | |
1039 | 1037 | | |
| |||
0 commit comments