test/py: Automated conversion to Python 3

Use the 2to3 tool to perform numerous automatic conversions from Python
2 syntax to Python 3.  Also fix whitespace problems that Python 3
catches that Python 2 did not.

Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org> [on sandbox]
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Tom Rini 2019-10-24 11:59:20 -04:00
parent 3c941e048c
commit fe1193e254
8 changed files with 64 additions and 73 deletions

View file

@ -27,9 +27,9 @@ def test_log(u_boot_console):
"""
for i in range(max_level):
if mask & 1:
assert 'log_run() log %d' % i == lines.next()
assert 'log_run() log %d' % i == next(lines)
if mask & 3:
assert 'func() _log %d' % i == lines.next()
assert 'func() _log %d' % i == next(lines)
def run_test(testnum):
"""Run a particular test number (the 'log test' command)
@ -43,7 +43,7 @@ def test_log(u_boot_console):
output = u_boot_console.run_command('log test %d' % testnum)
split = output.replace('\r', '').splitlines()
lines = iter(split)
assert 'test %d' % testnum == lines.next()
assert 'test %d' % testnum == next(lines)
return lines
def test0():
@ -88,7 +88,7 @@ def test_log(u_boot_console):
def test10():
lines = run_test(10)
for i in range(7):
assert 'log_test() level %d' % i == lines.next()
assert 'log_test() level %d' % i == next(lines)
# TODO(sjg@chromium.org): Consider structuring this as separate tests
cons = u_boot_console