fix(test): strip ANSI before --live substring check (v0.53.5 CI fix)

Rich splits the `--live` token across ANSI colour codes on narrow CI
terminals (`-\x1b[0m\x1b[1;36m-live`), so the raw-output substring
assertion failed on macOS/Windows runners but passed locally on a wide
terminal. Strip ANSI escapes before the check — matches how earlier test
files (e.g. test_v0402_part_b) handle Rich-coloured `--help` output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alpamys 2026-05-13 16:04:49 +05:00
parent bc1f060da9
commit 8bd67f697f
1 changed files with 7 additions and 2 deletions

View File

@ -650,13 +650,18 @@ def test_recipe_deepseek_v3_yaml_safe_load_structure():
def test_cli_mix_help_lists_live_flag():
import re
from soup_cli.cli import app
runner = CliRunner()
result = runner.invoke(app, ["data", "mix", "--help"])
assert result.exit_code == 0
assert "--live" in result.output
assert "--base-yaml" in result.output
# Strip ANSI escape sequences — Rich splits flag tokens across colour codes
# on narrow CI terminals, so a substring check on raw output fails.
plain = re.sub(r"\x1b\[[0-9;]*m", "", result.output)
assert "--live" in plain
assert "--base-yaml" in plain
def test_cli_mix_live_requires_base_yaml(tmp_path, monkeypatch):