aboutsummaryrefslogtreecommitdiffstats
path: root/testing/__init__.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2017-12-07 14:47:36 +0100
committerChristian Tismer <tismer@stackless.com>2017-12-21 15:04:31 +0000
commit5c7e140036e26d8dad27ef8b7da984f093e97787 (patch)
tree2af91f5f903be5a6ca8ea5d1b885ea6dc6c362b7 /testing/__init__.py
parent5f59ce344ffb1086b74e34fa24257b87d9325cd2 (diff)
testrunner 5: Improve the algorithm
Testrunner checks if it is running in COIN. If so, it runs each tested project 5 times and reports an error if 3 errors were found in a test function and not blacklisted. The time is measured, so we know if we can run all the tests five times or if we can run only the failed tests. At the moment, the option COIN_RERUN_FAILED_ONLY is activated by default. We can configure it by setting to false. Since this change turns the registry existence test into a flaky test (te tests generates it's missing file in the first run), the registry existence test is no more blacklisted. We simulate our own tee command now with decorated output. Task-number: PYSIDE-578 Change-Id: I6390cd50398a97a168c85c6bb778984c6a5b90fc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'testing/__init__.py')
-rw-r--r--testing/__init__.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/__init__.py b/testing/__init__.py
index a14b72f47..a540251cc 100644
--- a/testing/__init__.py
+++ b/testing/__init__.py
@@ -39,6 +39,23 @@
from __future__ import print_function
+import sys
from . import command
main = command.main
+
+# modify print so that it always flushes
+__builtins__["orig_print"] = __builtins__["print"]
+
+def print_flushed(*args, **kw):
+ orig_print(*args, **kw)
+ sys.stdout.flush()
+
+__builtins__["print"] = print_flushed
+
+print = print_flushed
+
+# We also could use "python -u" to get unbuffered output.
+# This method is better since it needs no change of the interface.
+
+# eof