Skip to content

Commit 36b5e21

Browse files
perlinmclaude
andauthored
coverage: enable parallel data files so modular coverage aggregates across files (#574)
The modular coverage check runs each file's tests in its own `coverage run` subprocess and merges the results with `coverage combine`. Without parallel data files every subprocess writes the same `.coverage` and overwrites the previous one, so `combine` finds nothing to merge and the final report reflects only the subprocess that happened to finish last. Whenever that last file is fully covered the check reports success even if other files have gaps. Setting `run.parallel = true` gives each subprocess a uniquely suffixed data file, so `combine` aggregates them all and the report spans every file. Correct aggregation surfaced two spots that no test exercised directly and that the missing aggregation had hidden: the `QuantumReedMullerCode.order`/`size` getters and the `TrivialGroup.to_ring_array` defunct-alias error. Add direct assertions for both. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d105640 commit 36b5e21

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ ini_options.filterwarnings = [
104104

105105
[tool.coverage]
106106
run.include = [ "./*" ]
107+
run.parallel = true
107108
report.fail_under = 100
108109
report.exclude_lines = [ "if TYPE_CHECKING:", "pragma: no cover" ]
109110
report.skip_covered = true

src/qldpc/abstract/groups_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def test_trivial_group() -> None:
9393
assert group.equiv(abstract.Group.from_generating_mats())
9494
assert str(group) == "TrivialGroup"
9595

96+
# to_ring_array is a defunct alias that only raises, directing callers to RingArray.build
97+
with pytest.raises(ValueError, match="DEFUNCT"):
98+
abstract.TrivialGroup.to_ring_array([[1]])
99+
96100

97101
def test_group_equality_and_equivalence() -> None:
98102
"""``==`` requires a matching representation; ``equiv`` compares underlying groups only."""

src/qldpc/codes/quantum_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ def test_reed_muller_css_codes() -> None:
10171017
((2, 10), (1024, 912, 8)),
10181018
]:
10191019
code = codes.QuantumReedMullerCode(order, size)
1020+
assert (code.order, code.size) == (order, size)
10201021
assert code.get_code_params() == params
10211022
assert code.get_distance() == params[2]
10221023
assert code.get_distance(Pauli.X) == params[2]

0 commit comments

Comments
 (0)