From c29e6e971b3881415b49f0f613d9911fdb31f613 Mon Sep 17 00:00:00 2001 From: Alexander Rybkin Date: Fri, 20 Nov 2026 18:50:34 -0800 Subject: [PATCH] test(cli): the concurrency help check passes on Python before 3.13 `--concurrency, -j N` is what argparse prints from Python 3.13; before that it repeats the metavar, `--concurrency N, -j N`. The check looked for the first form only, so it failed on Python 3.11 and 3.12 and has kept push runs of ci.yml on main red, where the whole version matrix runs. Pull requests run 3.14 only, so #957 passed. The pattern now accepts both renderings and still rejects the old metavar. Signed-off-by: Alexander Rybkin --- dokimi/tests/test_cli_f1b_reps.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dokimi/tests/test_cli_f1b_reps.py b/dokimi/tests/test_cli_f1b_reps.py index dbb72a3b3..3b4d36d50 100644 --- a/dokimi/tests/test_cli_f1b_reps.py +++ b/dokimi/tests/test_cli_f1b_reps.py @@ -5,6 +5,8 @@ from __future__ import annotations +import re + import pytest from dokimi import cli, cli_routes @@ -82,12 +84,13 @@ def test_an_old_spelling_is_not_moved_on_a_leaf_that_never_had_it(argv): (["subjects", "run"], "--reps N"), (["benchmark", "run"], "--reps N"), (["catalog", "trigger-probe"], "--reps N"), - (["repo", "run"], "--concurrency, -j N"), - (["eval", "check"], "--concurrency, -j N"), + (["repo", "run"], "--concurrency(?: N)?, -j N"), + (["eval", "check"], "--concurrency(?: N)?, -j N"), (["catalog", "check"], "--concurrency N"), ]) def test_help_shows_the_registry_metavar_not_the_old_name(argv, usage, capsys): + """``usage`` is a pattern: before Python 3.13 argparse repeats the metavar after each option string.""" with pytest.raises(SystemExit) as exc: cli.parse_args([*argv, "--help"]) assert exc.value.code == 0 - assert usage in capsys.readouterr().out + assert re.search(usage, capsys.readouterr().out)