fix to flush stdout after unit test execution

- added statement to flush the stdout
This commit is contained in:
Philipp M. Fischer
2019-10-02 09:54:39 +02:00
committed by wmayer
parent b2e9bef612
commit 0787ed8fbf

View File

@@ -68,7 +68,13 @@ def All():
def TestText(s):
s = unittest.defaultTestLoader.loadTestsFromName(s)
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
return r.run(s)
retval = r.run(s)
# Flushing to make sure the stream is written to the console
# before the wrapping process stops executing. Without this line
# executing the tests from command line did not show stats
# and proper tarceback in some cases.
sys.stdout.flush()
return retval
def Test(s):