From c71318e3420cdb7044818c9d101fd6d18181132e Mon Sep 17 00:00:00 2001 From: ddm Date: Thu, 2 Jan 2014 11:36:29 +0100 Subject: [PATCH] [FIX] UI test runner snafu bzr revid: ddm@openerp.com-20140102103629-r6sjvevgsihricte --- addons/website/tests/test_ui.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/website/tests/test_ui.py b/addons/website/tests/test_ui.py index cf88eefe203..508086bb7b1 100644 --- a/addons/website/tests/test_ui.py +++ b/addons/website/tests/test_ui.py @@ -6,7 +6,9 @@ import time import json from openerp import tools -__all__ = ['load_tests', 'WebsiteUiSuite'] +# avoid "ValueError: too many values to unpack" +def _exc_info_to_string(err, test): + return err # TODO according to al this should be one line of Python class LineReader: @@ -59,7 +61,11 @@ class WebsiteUiSuite(unittest.TestSuite): result.stopTest(test) return # ...then run the actual test - self._run(result) + result._exc_info_to_string = _exc_info_to_string + try: + self._run(result) + finally: + del result._exc_info_to_string def _run(self, result): self._test = WebsiteUiTest(self._testfile) @@ -78,8 +84,9 @@ class WebsiteUiSuite(unittest.TestSuite): os.path.join(os.path.join(os.path.dirname(__file__), 'ui_suite'), self._testfile), json.dumps(self._options) ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - proc_stdout = LineReader(phantom.stdout.fileno()) - readable = [proc_stdout] + + readable = [LineReader(phantom.stdout.fileno())] + try: while phantom.poll() is None and readable and last_check_time < start_time + self._timeout: ready, _, _ = select.select(readable, [], [], 0.1)