Skip to content

Commit 54e2410

Browse files
committed
Add comment for --single-process
1 parent cea9e1d commit 54e2410

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/libregrtest/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,9 @@ def setup_tests(runtests: RunTests) -> None:
141141

142142
random.seed(runtests.random_seed)
143143

144+
# sys.stdout is redirected to a StringIO in single process mode on which
145+
# color auto-detect fails as StringIO is not a TTY. If the original
146+
# sys.stdout supports color pass that through with FORCE_COLOR so that when
147+
# results are printed, such as with -W, they get color.
144148
if can_colorize(file=sys.stdout):
145149
os.environ['FORCE_COLOR'] = "1"

0 commit comments

Comments
 (0)