add_pr_links: add unit tests - #6209
Open
janniklasrose wants to merge 2 commits into
Open
Conversation
Cover entry splitting, end-of-entry placement, the skip-if-already-referenced behavior (including a body reference that must not block appending), blank handling, and process_file. Run with `uv run tools/add_pr_links_test.py`. Co-authored-by: Isaac
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
Add a `test-tools` task that discovers tools/*_test.py, and fold it into `checks` so the check.yml `task checks` step runs it. The test file also pulls add_pr_links' doctests into its suite via load_tests, so one run covers both. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: e08b9a3
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 6 slowest tests (at least 2 minutes):
|
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.
Changes
tools/add_pr_links_test.py— stdlibunittestcoverage foradd_pr_links.py, with the module's doctests folded in viaload_tests.test-toolsTaskfile task (discoverstools/*_test.py) and wire it intochecks, so thetask checksstep incheck.ymlruns it in CI.Why
tools/add_pr_links.pywas previously covered only by doctests that nothing in root-module CI ran. This locks the behavior in an explicit suite and makes it run on every PR, including the case where a prior PR/issue reference in an entry's body must not block appending the PR link at the end.Tests
./task test-tools(and./task checks) — 23 tests (20 unit + 3 doctest), all passing. Verified a failing test makes the task exit non-zero.Stacked on top of #6177.
This PR was written by Claude Code.