fix: CLI help test handles ANSI escape codes in Typer output

Rich/Typer may insert ANSI codes within option names like --register-bq,
breaking exact string matching in CI. Check parts separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZdenekSrotyr 2026-04-11 19:58:01 +02:00
parent 2ad8828f8c
commit 77d369e311

View file

@ -242,7 +242,11 @@ class TestQueryHybrid:
def test_register_bq_flag_help(self):
result = runner.invoke(app, ["query", "--help"])
assert result.exit_code == 0
assert "register-bq" in result.output
# Rich/Typer may insert ANSI escape codes within option names,
# so check for the parts separately
assert "register" in result.output
assert "bq" in result.output
assert "BigQuery" in result.output
class TestMetricsHelp: