use break instead of return so cleanup can eventually be put after loop if necessary (?)
bzr revid: xmo@openerp.com-
20140219101334-n8fcmzxptrqj717a
"""
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)
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")