Skip to content

Commit 108b9e8

Browse files
committed
test(templates): pin every clause of the parse-failure instruction
The regression test only pinned two of the five clauses the new instruction carries. Dropping the parser error, the mandatory-hook warning or the continuation clause from every template would have left it green. It now pins all five: the manifest could not be read, the parser error is included, no hooks were checked, mandatory (optional: false) hooks are named, and the command then continues. Checked by mutation: removing any one clause from all ten templates fails the ten parametrized cases.
1 parent fd73684 commit 108b9e8

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/test_command_template_hooks.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@
2727
r"^.*If the YAML cannot be parsed or is invalid.*$", re.MULTILINE
2828
)
2929
_SILENT = "skip hook checking silently"
30-
_REPORTED = ("could not be read", "no hooks were checked")
30+
# Every clause of the replacement instruction, so that dropping any one of
31+
# them from the templates fails the test: the manifest could not be read, the
32+
# parser error is shown, no hooks were checked, mandatory hooks are named, and
33+
# the command still continues afterwards.
34+
_REPORTED = (
35+
"could not be read",
36+
"include the parser error",
37+
"no hooks were checked",
38+
"including any mandatory (`optional: false`) hooks",
39+
"then continue",
40+
)
3141

3242
HOOK_TEMPLATES = sorted(
3343
p.name

0 commit comments

Comments
 (0)