Repository navigation
tests: fail when a design.md table has the same row twice - #3132
Conversation
When two pull requests edit the same row of the contract table, the merge keeps both versions one under the other, and the older text then contradicts the newer one. That has been cleaned up by hand several times (ItsNotRexed#1108, 8b606c2, 935edd4, cb467ea), and it keeps coming back because nothing notices. tests/test_design_contract_rows.py reads docs/design.md and fails when a table has two rows with the same first cell, listing the row names and line numbers. Rows are counted per table, so two tables may each have a row with the same name, and separator rows and empty first cells don't count. It passes on main today. Standard library only.
|
Tested at the head on Windows 11 / Python 3.13.0: the new file is Negative control: duplicating the Note, not a defect: ~17 open PRs edit Minor: only rows starting at column 0 are counted ( Merge-ready. AI-assisted review, docs/tests only. |
|
Tested
Suggestion: rather than a second test file, put the idea into AI-assisted testing and reading, checked by hand. |
Claimed in the coordination issue as: #1218 (comment)
What and why
When two PRs edit the same row of the contract table, the merge keeps both versions one under the other, and the older text then contradicts the newer one. That has been cleaned up by hand several times (#1108, then 8b606c2, 935edd4 and cb467ea today), and it keeps coming back because nothing notices.
I had a dedupe ready for this claim, but main already removed every duplicate row while it waited, so this PR is just the test that keeps them out.
tests/test_design_contract_rows.pyreadsdocs/design.mdand fails when a table has two rows with the same first cell, listing the row names and line numbers. Rows are counted per table, so two different tables may each have a row with the same name, and separator rows and empty first cells don't count. Standard library only.Tested
python -I tests/test_design_contract_rows.py: 4 pass on main at ec8ec4c.Checklist
docs/design.md, with how it was confirmed. (n/a: a test only)