This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Patch to flush unittest output
Type: Stage:
Components: Versions: Python 3.0
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 2022-04-11 14:56 by admin. This issue is now closed.

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.
Date User Action Args
2022-04-11 14:56:34adminsetgithub: 47036
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