Commit a3fa85f
scripts: keep PASSED/FAILED color when --timing pipes pytest output
--timing captures pytest's stdout through a Popen pipe so we can
extract the durations section. pytest's --color=auto then sees a
non-TTY on the other end of the pipe and turns ANSI color off, so
green PASSED / red FAILED disappear in the user's terminal.
Pass --color=yes when our own stdout is itself a TTY (so the user
will see the codes rendered) but leave color off when the user is
piping run_tests.py to a file or another process — same heuristic
pytest's auto would have used if it could see past our capture.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0c303ec commit a3fa85f
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
133 | 137 | | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
0 commit comments