Commit 52962ae
tests: pin render width suite-wide so --help asserts match CI (#147)
The fixed_render_size fixture (COLUMNS=80/LINES=40) was opt-in, used
only by
the snapshot modules. The ~20 other test files that assert against
--help or
rendered CLI output ran at whatever width the environment supplied.
Rich's
no-clip help table ellipsizes a long flag name ("--end-of-turn-c…") once
its
column overflows, so a substring assert like `"--with-api-key" in help`
passes
at a contributor's wide local terminal and fails at CI's narrower width.
That gap cost one PR three CI rounds on a single test
(test_api_key_flag_is_hidden_from_help). Making the fixture autouse pins
the
render width for every test, so a local green is a CI green for output
tests.
Tests that need a different width still override it per call
(runner.invoke(app, argv, env={"COLUMNS": "300"})).
Document the lesson in tests/AGENTS.md.
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8e39d2a commit 52962ae
2 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
0 commit comments