Buffering test output¶
Buffer stdout and/or stderr during test execution, appending any output to the error reports of failed tests.
This allows you to use print for debugging in tests without making your test runs noisy.
This plugin implements startTest()
, stopTest()
,
setTestOutcome()
, outcomeDetail()
, beforeInteraction()
and afterInteraction()
to manage capturing sys.stdout and/or
sys.stderr into buffers, attaching the buffered output to test error
report detail, and getting out of the way when other plugins want to
talk to the user.
Configuration [output-buffer]¶
-
always-on
¶ Default: False Type: boolean
-
stderr
¶ Default: False Type: boolean
-
stdout
¶ Default: True Type: boolean
Sample configuration¶
The default configuration is equivalent to including the following in a unittest.cfg
file.
[output-buffer]
always-on = False
stderr = False
stdout = True