Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/project/test_issue_pr_kinds_2561.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ def test_the_body_fills_in_the_template(self) -> None:
self.assertNotIn('Explanation of your *pull request*', text)
self.assertIn('[Searched]', text)

def test_the_body_marks_the_templates_changelog_box_not_applicable(self) -> None:
boxes = [line for line in issue_pr_kinds.TEMPLATE.read_text(encoding='utf-8').splitlines()
if line.startswith('- [ ] ') and 'changelog' in line]
self.assertEqual(len(boxes), 1, boxes)
text = issue_pr_kinds.body(TEXT, 'https://run')
self.assertIn(f'{boxes[0]} — N/A — centralised in #657\n', text)
self.assertEqual(text.count('N/A — centralised in #657'), 1)


if __name__ == '__main__':
unittest.main()
3 changes: 2 additions & 1 deletion util/issue_pr_kinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def body(kinds_text: 'str', run_url: 'str') -> 'str':
text = re.sub(r'(?m)^- \[ \] `test`', '- [x] `test`', text)
text = re.sub(r'(?m)^(- \[ \] `make test` passes.*)$', r"\1 -- not run here; this pull request's checks run it",
text)
text = re.sub(r'(?m)^(- \[ \] Added a \[changelog entry\].*)$', r'\1 — N/A — centralised in #657', text)
# The changelog box, found by its link rather than by the wording around it.
text = re.sub(r'(?m)^(- \[ \] .*\[changelog entry\].*)$', r'\1 — N/A — centralised in #657', text)
description = (f'Regenerated `{PATH}` from the tracker with `python util/issue_pr_kinds.py`, up to #{newest}, '
'so `tests/project/test_docs_issue_pr_roles_1103_unit.py` checks every role citing a number '
f'up to it. Opened by the Issue and PR Kinds workflow ({run_url}); a later run force-pushes '
Expand Down
Loading