[Python-checkins] r63069 - python/trunk/Lib/unittest.py
georg.brandl
python-checkins at python.org
Sun May 11 17:17:41 CEST 2008
Author: georg.brandl
Date: Sun May 11 17:17:41 2008
New Revision: 63069
Log:
#2787: Flush stdout after writing test name, helpful when running
hanging or long-running tests. Patch by Adam Olsen.
Modified:
python/trunk/Lib/unittest.py
Modified: python/trunk/Lib/unittest.py
==============================================================================
--- python/trunk/Lib/unittest.py (original)
+++ python/trunk/Lib/unittest.py Sun May 11 17:17:41 2008
@@ -682,6 +682,7 @@
if self.showAll:
self.stream.write(self.getDescription(test))
self.stream.write(" ... ")
+ self.stream.flush()
def addSuccess(self, test):
TestResult.addSuccess(self, test)
@@ -689,6 +690,7 @@
self.stream.writeln("ok")
elif self.dots:
self.stream.write('.')
+ self.stream.flush()
def addError(self, test, err):
TestResult.addError(self, test, err)
@@ -696,6 +698,7 @@
self.stream.writeln("ERROR")
elif self.dots:
self.stream.write('E')
+ self.stream.flush()
def addFailure(self, test, err):
TestResult.addFailure(self, test, err)
@@ -703,6 +706,7 @@
self.stream.writeln("FAIL")
elif self.dots:
self.stream.write('F')
+ self.stream.flush()
def printErrors(self):
if self.dots or self.showAll:
More information about the Python-checkins
mailing list