Skip to content

test: enforce 100% line and branch coverage on Codecov - #1834

Draft
ariostas wants to merge 19 commits into
scikit-hep:mainfrom
ariostas:test/enforce-coverage
Draft

ariostas wants to merge 19 commits into
scikit-hep:mainfrom
ariostas:test/enforce-coverage

Conversation

@ariostas

@ariostas ariostas commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

The last PR of the split of #1814, to merge after all the others. Until then, it targets main and contains the commits of the ones still open (#1830–#1833). Its own changes are the last three commits. The main one is "test: enforce 100% line and branch coverage on Codecov":

  • codecov.yml requires 100% of the project and of each patch, and pyproject.toml turns on branch coverage. Codecov counts the CPU job plus the CUDA 13 GPU job (after_n_builds: 2), since some RNTuple code only runs on the GPU.
  • Code that can't be reached is marked with # pragma: no cover (reason) or # pragma: no branch (reason). Impossible elif chains end with raise AssertionError(...), which coverage excludes. That exclusion also covers about 30 raise AssertionError lines that were already in src/; the review of this PR checked the ones that could matter (the abstract placeholders of AsContainer, Container, Interpretation and Library, the _length_bytes checks, and TBranch basket ranges) and found none reachable.
  • Dead code is removed, including the code that dev/make-models.py generated after an unconditional raise. The generator is changed too, so it doesn't come back.
  • AGENTS.md describes the coverage rule, and the README gets a coverage badge.

The other two commits cover code that changed after the split. test_1834_cov_rntuple_unknown_types.py covers two checks from #1812 that reject an RNTuple chunk with unknown types. test_1720_graphed_read.py now calls the whole-dataset loader of uproot.graphed directly, because from graphed 0.0.11 session.materialize no longer goes through it when no file has the tree.

With all the PRs below, the full suite has 100% line and branch coverage in a container that mirrors the coverage job (apart from the GPU-only code, which the CUDA job covers).

PR Contents
#1824 fix: interpretations (containers, object and string arrays, libraries, identification)
#1825 fix: file reading and sources (HTTP, XRootD, empty requests, uproot.dask with grouped TBranches)
#1826 fix: variances of unweighted histogram bins of negative content
#1827 fix: writing (keys past 2 GB, streamers, TTrees, TArray dtypes, directory cycles)
#1828 fix: RNTuple reading and writing, on the CPU and the GPU
#1823 test: changes to existing tests and fixtures that don't depend on the fixes
#1841 test: interpretations (replaces #1829, which was merged into test/existing-tests by mistake)
#1830 test: file reading, sources and utilities
#1831 test: models and histograms
#1832 test: TTree and RNTuple reading APIs
#1833 test: writing

The fix PRs and #1823 are independent of each other, and the five test PRs only need #1823, which is merged, so they now target main.

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (30b7f1f) to head (b68070e).

Additional details and impacted files
Files with missing lines Coverage Δ
src/uproot/_dask.py 100.00% <100.00%> (+12.56%) ⬆️
src/uproot/_util.py 100.00% <ø> (+21.83%) ⬆️
src/uproot/behaviors/RNTuple.py 100.00% <100.00%> (+20.85%) ⬆️
src/uproot/behaviors/TBranch.py 100.00% <100.00%> (+11.55%) ⬆️
src/uproot/behaviors/TGraphAsymmErrors.py 100.00% <ø> (+21.21%) ⬆️
src/uproot/containers.py 100.00% <100.00%> (+1.78%) ⬆️
src/uproot/interpretation/identify.py 100.00% <ø> (+0.52%) ⬆️
src/uproot/interpretation/library.py 100.00% <100.00%> (+5.17%) ⬆️
src/uproot/models/RNTuple.py 100.00% <ø> (+19.20%) ⬆️
src/uproot/models/TArray.py 100.00% <ø> (+17.80%) ⬆️
... and 11 more

... and 57 files with indirect coverage changes

New tests from scikit-hep#1814, apart from the regression tests of its fixes.

Assisted-by: Claude Code:claude-opus-5-5
The test of closing an fsspec source with failing workarounds now checks
that both were tried, and the test of splitting XRootD ranges checks the
sizes of the vector-read elements. The local HTTP server polls for shutdown
every 0.01 s instead of 0.5 s, which every test waited for. The two tests of
test_1654 that test_1830_cov_io_futures.py replaces are deleted here.

Assisted-by: Claude Code:claude-opus-5-5
New tests from scikit-hep#1814, apart from the regression tests of its fixes.

Assisted-by: Claude Code:claude-opus-5-5
New tests from scikit-hep#1814, apart from the regression tests of its fixes.

Assisted-by: Claude Code:claude-opus-5-5
The ROOT fixture also declared classes and writers that only the tests of
scikit-hep#1828 use; if any of them didn't compile with some ROOT version, the tests
here would fail too. gErrorIgnoreLevel is now restored if something fails
while it's lowered. The four LRUCache tests of test_1661 that
test_1832_cov_api_cache.py replaces are deleted here.

Assisted-by: Claude Code:claude-opus-5-5
New tests from scikit-hep#1814, apart from the regression tests of its fixes.

Assisted-by: Claude Code:claude-opus-5-5
The edges of the variable-width axis spanned exactly fXmin to fXmax, so the
test couldn't tell the mean of the widths from (fXmax - fXmin) / fNbins. The
files that Rewritable opens are now closed after each test. The test of a
version 3 TStreamerElement leaves for scikit-hep#1824, which reads its range.

Assisted-by: Claude Code:claude-opus-5-5
Extending an RNTuple with lists that are all empty now works, and
test_1812 checks it, including that other mismatched types still fail.

Assisted-by: Claude Code:claude-opus-5-5
…files

Four tests skipped without ROOT before checking anything with uproot; now
only their ROOT checks need it. The test of updating a file object closes
both files. The test that the first of two branches with the same name was
kept leaves for scikit-hep#1827, which rejects such names instead.

Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
With the tests of the previous PRs, every reachable line and branch is
covered. Codecov now requires 100% of the project and of each patch, with
branch coverage. Code that can't be reached is marked with
"# pragma: no cover  (reason)" or "# pragma: no branch  (reason)", ends
impossible elif chains with "raise AssertionError" (excluded from coverage),
or is removed when it was dead, including the dead code that
dev/make-models.py generated after unconditional raises.

Assisted-by: Claude Code:claude-opus-5-5
scikit-hep#1812 merged after the coverage PRs were split, and two of the ways a
chunk with unknown types can mismatch the schema weren't tested: a
field of a different kind, and a record with different fields.

Assisted-by: Claude Code:claude-opus-5-5
From graphed 0.0.11, session.materialize no longer goes through it for a
dataset whose only file lacks the tree, so the test didn't reach the
loader's handling of missing trees anymore.

Assisted-by: Claude Code:claude-opus-5-5
@ariostas
ariostas force-pushed the test/enforce-coverage branch from 4c57e39 to b68070e Compare November 12, 2026 20:09
@ariostas
ariostas marked this pull request as draft November 12, 2026 20:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/test PR title type: test (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant