File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232@fixture
3333def 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
3741def 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
140148def test_profiles_list (cli_runner : CliRunner ):
You can’t perform that action at this time.
0 commit comments