From 8bd67f697fb35eeec94c9fa6feb440ff6b1d3968 Mon Sep 17 00:00:00 2001 From: Alpamys Date: Wed, 13 May 2026 16:04:49 +0500 Subject: [PATCH] fix(test): strip ANSI before --live substring check (v0.53.5 CI fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- tests/test_v0535.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_v0535.py b/tests/test_v0535.py index 25142b6..63e6b13 100644 --- a/tests/test_v0535.py +++ b/tests/test_v0535.py @@ -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):