From 9b71831ec9ac6033517b518a433224d7b7f807b0 Mon Sep 17 00:00:00 2001 From: Alexander Rybkin Date: Fri, 30 Oct 2026 18:05:05 -0700 Subject: [PATCH] test(cli): pin the run/compare one-line help text, not just a label The regex matched the command name followed by a cost label, so the test passed with no help text at all (summary_of returning None). Assert the literal lines the route table supplies. Signed-off-by: Alexander Rybkin --- dokimi/tests/test_cli_routes.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dokimi/tests/test_cli_routes.py b/dokimi/tests/test_cli_routes.py index cf80f27b3..89e11e278 100644 --- a/dokimi/tests/test_cli_routes.py +++ b/dokimi/tests/test_cli_routes.py @@ -165,9 +165,13 @@ def test_run_and_compare_have_a_one_line_help_in_the_top_level_list(monkeypatch) # wrap the cost label onto a continuation line, so pin the width the label is read at. monkeypatch.setenv("COLUMNS", "200") text = build_parser().format_help() - for name in ("run", "compare"): + expected = { + "run": "Run the static benchmark spec and save a snapshot [free]", + "compare": "Compare two saved benchmark snapshots [free]", + } + for name, help_line in expected.items(): line = next(line for line in text.splitlines() if re.match(rf"^ {name}\s", line)) - assert re.search(r"\S.* \[(free|paid)\]$", line), line + assert line.split(None, 1)[1] == help_line, line def test_route_table_matches_the_parser_leaves_and_roots():