#2787: Flush stdout after writing test name, helpful when running

hanging or long-running tests. Patch by Adam Olsen.
This commit is contained in:
Georg Brandl 2008-05-11 15:17:41 +00:00
parent b52a74b517
commit d063240d91
1 changed files with 4 additions and 0 deletions

View File

@ -682,6 +682,7 @@ class _TextTestResult(TestResult):
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 @@ class _TextTestResult(TestResult):
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 @@ class _TextTestResult(TestResult):
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 @@ class _TextTestResult(TestResult):
self.stream.writeln("FAIL")
elif self.dots:
self.stream.write('F')
self.stream.flush()
def printErrors(self):
if self.dots or self.showAll: