diff --git a/openerp/tests/common.py b/openerp/tests/common.py index 70412067f6e..901f0d9857b 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -189,7 +189,7 @@ class HttpCase(TransactionCase): """ t0 = time.time() buf = bytearray() - while 1: + while True: # timeout self.assertLess(time.time(), t0 + timeout, "PhantomJS tests should take less than %s seconds" % timeout) @@ -203,16 +203,15 @@ class HttpCase(TransactionCase): if ready: s = phantom.stdout.read(1) - if s: - buf.append(s) - else: + if not s: break + buf.append(s) # process lines if '\n' in buf: line, buf = buf.split('\n', 1) if line == "ok": - return + break if line.startswith("error"): # 'error $message' or use generic message self.fail(line[6:] or "phantomjs test failed")