@@ -167,8 +167,19 @@ class TestExportCliFlagWiring: |
| 167 | | 167 | |
| 168 | from dlm.cli.app import app | 168 | from dlm.cli.app import app |
| 169 | | 169 | |
| 170 | - runner = CliRunner() | 170 | + # Force a wide terminal so typer/Rich don't wrap the long |
| | 171 | + # ``--emit-sway-json`` flag across lines (CI's runner has a |
| | 172 | + # narrow default that breaks substring asserts). |
| | 173 | + runner = CliRunner(env={"COLUMNS": "200", "TERM": "dumb"}) |
| 171 | result = runner.invoke(app, ["export", "--help"]) | 174 | result = runner.invoke(app, ["export", "--help"]) |
| 172 | assert result.exit_code == 0, result.output | 175 | assert result.exit_code == 0, result.output |
| 173 | - assert "--emit-sway-json" in result.output | 176 | + # Strip any ANSI escapes so a substring match is robust to |
| 174 | - assert "sway.yaml" in result.output | 177 | + # color codes inserted at arbitrary positions. |
| | 178 | + import re |
| | 179 | + |
| | 180 | + plain = re.sub(r"\x1b\[[0-9;]*m", "", result.output) |
| | 181 | + # Collapse whitespace so wrap-induced line breaks within the |
| | 182 | + # flag name still match — belt + braces with the COLUMNS env. |
| | 183 | + plain = re.sub(r"\s+", " ", plain) |
| | 184 | + assert "--emit-sway-json" in plain, plain |
| | 185 | + assert "sway.yaml" in plain, plain |