8000 Ensure gh-issue or bpo exists in metadata · python/blurb@04b6913 · GitHub
[go: up one dir, main page]

Skip to content

Commit 04b6913

Browse files
committed
Ensure gh-issue or bpo exists in metadata
1 parent 657a617 commit 04b6913

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/blurb/blurb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ def finish_entry():
497497
if value not in sections:
498498
throw(f"Invalid section {value!r}! You must use one of the predefined sections.")
499499

500+
if "gh-issue" not in metadata and "bpo" not in metadata:
501+
throw("'gh-issue:' or 'bpo:' must be specified in the metadata!")
502+
500503
if not 'section' in metadata:
501504
throw("No 'section' specified. You must provide one!")
502505

tests/test_blurb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ def test_parse():
240240
".. gh-issue: 123456\n.. section: IDLE\n.. section: IDLE\nHello world!",
241241
r"Blurb metadata sets 'section' twice!",
242242
),
243+
(
244+
".. section: IDLE\nHello world!",
245+
r"'gh-issue:' or 'bpo:' must be specified in the metadata!",
246+
),
243247
),
244248
)
245249
def test_parse_no_body(contents, expected_error):

0 commit comments

Comments
 (0)
0