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.

Author petere
Recipients petere
Date 2011-10-20.19:02:03
SpamBayes Score 1.02807e-12
Marked as misclassified No
Message-id <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
In-reply-to
Content
I'm using the TextTestRunner class in unittest/runner.py with a special file-like object passed in as stream.  Doing this loses some output, because the run() method (and some lower-level methods) don't always call flush() on the stream.  There is also no obvious cleanup method in the runner class that might do this, so I assume run() should do that itself.

Right now, it looks like it assumes that either the stream is effectively unbuffered, like stderr, or that the end of the program might flush things, but that doesn't always apply.

It looks like the best fix would be a self.stream.flush() call at the end of run().  Another flush() call at the end of printErrorList() would also help.

(In the meantime, I have fixed up my special file-like class to flush its internal buffers when a newline is seen, which kind of works, but a proper cleanup of this matter would still be nice.)
History
Date User Action Args
2011-10-20 19:02:04peteresetrecipients: + petere
2011-10-20 19:02:04peteresetmessageid: <1319137324.16.0.266090134048.issue13236@psf.upfronthosting.co.za>
2011-10-20 19:02:03peterelinkissue13236 messages
2011-10-20 19:02:03peterecreate