Repository navigation
test(novelty): pin a colon-ended cited span last in the document - #1098
Merged
Merged
Conversation
…Following line Settles the open point on intel#1072 (discussion_r4655519764): no test put a colon-ended cited span last in the document, so changing `after < len(spans)` to `after <= len(spans)` in `context_for` left all tests green. The new test cites `# T\n\nLead:\n` with `Lead:` and asserts the context is exactly `Heading: T`; with the looser guard `context_for` raises IndexError and the test fails. No production code changes. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1098 +/- ##
==========================================
- Coverage 96.08% 96.07% -0.02%
==========================================
Files 461 461
Lines 60836 60836
Branches 10517 10517
==========================================
- Hits 58457 58448 -9
- Misses 1473 1478 +5
- Partials 906 910 +4 🚀 New features to boost your workflow:
|
vchamarthi
approved these changes
Nov 22, 2026
vchamarthi
left a comment
Contributor
There was a problem hiding this comment.
Approving 10687f3.
Checked: changed tests: 19 passed, pass on main too; full suite with main merged in: 26393 passed, its only failures are main's too; merges onto main; 1 mutation tried.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the review of #1072, where no test put a colon-ended cited span last in the document (review). The author agreed the code is right (
after < len(spans)incontext_for) and the missing test was left open.On main, changing that guard to
after <= len(spans)leaves all 18 tests oftests/test_novelty_verify_context.pygreen, althoughcontext_foronsegment("# T\n\nLead:\n")withLead:cited then raisesIndexError. Every existing colon test has a span after the cited one.Changes
dokimi/tests/test_novelty_verify_context.py:test_a_colon_ended_cited_span_last_in_the_document_gets_no_following_spancitesLead:insegment("# T\n\nLead:\n")and asserts the context is exactlyHeading: T, with noFollowing:line and no error (thecontext_fordocstring adds the very next span asFollowing:only when there is one).dokimi/tests/only.Risk
None: a test is added and the output of dokimi is unchanged.
Testing
On a Linux review host, at
10687f37(onmain06341ca):make ci-local: 38 passed, 0 failed, 14 skipped (docker-only smoke, the Python matrix legs, conda-forge, atheris fuzz, semgrep, deploy/report jobs whose condition is false on a PR). 25980 tests passed, 19 skipped; the diff has no measurable changed lines for coverage.after < len(spans)changed toafter <= len(spans)incontext_for, the new test fails withIndexError: list index out of rangeand the other 18 pass.Revert
A plain revert removes the test. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)