From b7034b6b3896d1a341bde203f44d98208ea6420d Mon Sep 17 00:00:00 2001 From: Dan Villiom Podlaski Christiansen Date: Tue, 4 Sep 2018 22:00:13 +0200 Subject: [PATCH] flush output stream after writing This should make Jenkins print the output immediately, rather than as chunks. --- xmlrunner/result.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmlrunner/result.py b/xmlrunner/result.py index 611f51c..a49184f 100644 --- a/xmlrunner/result.py +++ b/xmlrunner/result.py @@ -233,6 +233,9 @@ def callback(): ) elif self.dots: self.stream.write(short_str) + + self.stream.flush() + self.callback = callback def startTest(self, test): @@ -245,6 +248,7 @@ def startTest(self, test): if self.showAll: self.stream.write(' ' + self.getDescription(test)) self.stream.write(" ... ") + self.stream.flush() def _setupStdout(self): """ @@ -364,6 +368,7 @@ def printErrorList(self, flavour, errors): ) self.stream.writeln(self.separator2) self.stream.writeln('%s' % test_info.get_error_info()) + self.stream.flush() def _get_info_by_testcase(self): """