diff options
author | Georg Brandl <georg@python.org> | 2008-05-11 15:17:41 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-11 15:17:41 (GMT) |
commit | d063240d9141c1207ae7a88f3dc9f7576d49a056 (patch) | |
tree | 14ca2e3f9ea010064fdf5062440bd13dc76c1063 /Lib/unittest.py | |
parent | b52a74b5171f66bf38f7373e50c8515f2e6ab587 (diff) | |
download | cpython-d063240d9141c1207ae7a88f3dc9f7576d49a056.zip cpython-d063240d9141c1207ae7a88f3dc9f7576d49a056.tar.gz cpython-d063240d9141c1207ae7a88f3dc9f7576d49a056.tar.bz2 |
#2787: Flush stdout after writing test name, helpful when running
hanging or long-running tests. Patch by Adam Olsen.
Diffstat (limited to 'Lib/unittest.py')
-rw-r--r-- | Lib/unittest.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py index eccefe6..b89fb47 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -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: |