Skip to content

Commit bff18bf

Browse files
committed
Update test_cli.py
Reverting back to partial match, would require more complicated ASCII character stripping not just `color=False`
1 parent 8ac7f94 commit bff18bf

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/unit/test_cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ def test_main_with_bad_thresholds(
164164
) -> None:
165165
"""Test cli with bad thresholds."""
166166
result = create_typer_cli_runner.invoke(
167-
cli.app, [str(sample_data_gt3x), "-t", "3.0"], color=False
167+
cli.app, [str(sample_data_gt3x), "-t", "3.0"]
168168
)
169169

170170
assert result.exit_code != 0
171-
assert "Option '-t' requires 3 arguments." in result.output
171+
# partial matching due to ANSI escape sequences in Github Actions
172+
assert "requires 3 arguments." in result.output
172173

173174

174175
def test_main_with_bad_epoch(
@@ -177,14 +178,13 @@ def test_main_with_bad_epoch(
177178
) -> None:
178179
"""Test cli with invalid epoch length."""
179180
result = create_typer_cli_runner.invoke(
180-
cli.app, [str(sample_data_gt3x), "-e", "-5"], color=False
181+
cli.app, [str(sample_data_gt3x), "-e", "-5"]
181182
)
182183

183184
assert result.exit_code != 0
184-
assert (
185-
"Invalid value for '-e' / '--epoch-length': -5 is not in the range x>=1."
186-
in result.output
187-
)
185+
# partial matching due to ANSI escape sequences in Github Actions
186+
assert "Invalid value for" in result.output
187+
assert "is not in the range x>=1." in result.output
188188

189189

190190
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)