Skip to content

Commit 4e09941

Browse files
fix(tests): strip ANSI codes in core info CLI assertions
Assisted-by: GitHub Copilot (model: GPT-5.3-Codex, autonomous) Co-authored-by: nicolehaugen <10600161+nicolehaugen@users.noreply.github.com>
1 parent 930d87b commit 4e09941

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎tests/test_core_info_command.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from typer.testing import CliRunner
1111

1212
from specify_cli import app
13+
from tests.conftest import strip_ansi
1314

1415

1516
def _invoke(args: list[str]):
@@ -33,19 +34,19 @@ def test_core_info_without_json_exits_nonzero() -> None:
3334
result = _invoke(["core", "info"])
3435
assert result.exit_code != 0
3536
# Message points at the flag; user knows what to do.
36-
assert "--json" in result.output
37+
assert "--json" in strip_ansi(result.output)
3738

3839

3940
def test_core_info_help_lists_json_flag() -> None:
4041
result = _invoke(["core", "info", "--help"])
4142
assert result.exit_code == 0
42-
assert "--json" in result.output
43+
assert "--json" in strip_ansi(result.output)
4344

4445

4546
def test_specify_root_help_shows_core_group() -> None:
4647
result = _invoke(["--help"])
4748
assert result.exit_code == 0
48-
assert "core" in result.output.lower()
49+
assert "core" in strip_ansi(result.output).lower()
4950

5051

5152
# ---------------------------------------------------------------------------
@@ -179,4 +180,4 @@ def test_core_info_missing_command_file_exits_nonzero(
179180
assert result.exit_code == 1
180181
# CliRunner mixes streams by default; parse the envelope out of the output.
181182
# Look for the JSON envelope keys — that's enough to confirm the shape.
182-
assert "core_inventory.missing_file" in result.output
183+
assert "core_inventory.missing_file" in strip_ansi(result.output)

0 commit comments

Comments
 (0)