From 0787ed8fbf0d8f8b8162f69aaaeb2cd5553d146a Mon Sep 17 00:00:00 2001 From: "Philipp M. Fischer" <35496033+PhilMFischer@users.noreply.github.com> Date: Wed, 2 Oct 2019 09:54:39 +0200 Subject: [PATCH] fix to flush stdout after unit test execution - added statement to flush the stdout --- src/Mod/Test/TestApp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Test/TestApp.py b/src/Mod/Test/TestApp.py index 6f851e2e0d..ab09b13cb4 100644 --- a/src/Mod/Test/TestApp.py +++ b/src/Mod/Test/TestApp.py @@ -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):