Kaydet (Commit) d063240d authored tarafından Georg Brandl's avatar Georg Brandl

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

hanging or long-running tests. Patch by Adam Olsen.
üst b52a74b5
...@@ -682,6 +682,7 @@ class _TextTestResult(TestResult): ...@@ -682,6 +682,7 @@ class _TextTestResult(TestResult):
if self.showAll: if self.showAll:
self.stream.write(self.getDescription(test)) self.stream.write(self.getDescription(test))
self.stream.write(" ... ") self.stream.write(" ... ")
self.stream.flush()
def addSuccess(self, test): def addSuccess(self, test):
TestResult.addSuccess(self, test) TestResult.addSuccess(self, test)
...@@ -689,6 +690,7 @@ class _TextTestResult(TestResult): ...@@ -689,6 +690,7 @@ class _TextTestResult(TestResult):
self.stream.writeln("ok") self.stream.writeln("ok")
elif self.dots: elif self.dots:
self.stream.write('.') self.stream.write('.')
self.stream.flush()
def addError(self, test, err): def addError(self, test, err):
TestResult.addError(self, test, err) TestResult.addError(self, test, err)
...@@ -696,6 +698,7 @@ class _TextTestResult(TestResult): ...@@ -696,6 +698,7 @@ class _TextTestResult(TestResult):
self.stream.writeln("ERROR") self.stream.writeln("ERROR")
elif self.dots: elif self.dots:
self.stream.write('E') self.stream.write('E')
self.stream.flush()
def addFailure(self, test, err): def addFailure(self, test, err):
TestResult.addFailure(self, test, err) TestResult.addFailure(self, test, err)
...@@ -703,6 +706,7 @@ class _TextTestResult(TestResult): ...@@ -703,6 +706,7 @@ class _TextTestResult(TestResult):
self.stream.writeln("FAIL") self.stream.writeln("FAIL")
elif self.dots: elif self.dots:
self.stream.write('F') self.stream.write('F')
self.stream.flush()
def printErrors(self): def printErrors(self):
if self.dots or self.showAll: if self.dots or self.showAll:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment