Skip to content

Commit 379d297

Browse files
committed
test(cli): 🔧 fix config to support small terminals windows
1 parent 63acb6a commit 379d297

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/test_cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131

3232
@fixture
3333
def cli_runner() -> CliRunner:
34-
return CliRunner()
34+
# Force a wide terminal: the CLI renders output through Rich, which wraps
35+
# and truncates tables/panels to the terminal width (defaulting to 80
36+
# columns when stdout is captured). Pinning COLUMNS keeps the rendered
37+
# output deterministic regardless of the environment's actual width.
38+
return CliRunner(env={"COLUMNS": "200"})
3539

3640

3741
def test_version(cli_runner: CliRunner):
@@ -134,7 +138,11 @@ def test_validate_with_invalid_profiles_path_dir(cli_runner: CliRunner):
134138
)
135139
assert result.exit_code == 2
136140
# logger.debug(result.output)
137-
assert re.search(f"Path '{dummy_profiles_path}' does not exist.", result.output)
141+
# On narrow terminals the Rich error panel wraps the message across lines
142+
# and inserts box-drawing borders (│) between words; strip those and
143+
# collapse whitespace so the match does not depend on terminal width.
144+
normalized_output = re.sub(r"[\s│]+", " ", result.output)
145+
assert re.search(f"Path '{dummy_profiles_path}' does not exist.", normalized_output)
138146

139147

140148
def test_profiles_list(cli_runner: CliRunner):

0 commit comments

Comments
 (0)