classification
Title: Patch to flush unittest output
Type: Stage:
Components: Versions: Python 3.0
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: Rhamphoryncus, georg.brandl
Priority: normal Keywords: patch

Created on 2008-05-07 21:27 by Rhamphoryncus, last changed 2008-05-11 15:17 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
python-unittest_flush.diff Rhamphoryncus, 2008-05-07 21:27
Messages (3)
msg66375 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-05-07 21:27
In 3.0, unittest's output has become line buffered.  Instead of printing
the test name when it starts a test, then "ok" when it finishes, the
test name is delayed until the "ok" is printed.  This makes it
unnecessarily hard to determine which test is hanging or segfaulted.

The attached patch adds explicit flushes.

An alternative approach would be to force stdout to be unbuffered
somehow.  I don't know how difficult that would be.
msg66376 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-05-07 21:48
Hrm, this behaviour exists in trunk as well.  I must be confused about
the cause (but the patch still fixes it.)
msg66639 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-11 15:17
Thanks, committed patch as r63069.
History
Date User Action Args
2008-05-11 15:17:52georg.brandlsetstatus: open -> closed
resolution: accepted
messages: + msg66639
nosy: + georg.brandl
2008-05-07 21:48:23Rhamphoryncussetmessages: + msg66376
2008-05-07 21:27:24Rhamphoryncuscreate