[IMP] style

use break instead of return so cleanup can eventually be put after loop if necessary (?)

bzr revid: xmo@openerp.com-20140219101334-n8fcmzxptrqj717a
This commit is contained in:
Xavier Morel 2014-02-19 11:13:34 +01:00
parent abb58ee3b8
commit fbead8fab1
1 changed files with 4 additions and 5 deletions

View File

@ -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")