mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 17:22:22 +02:00
patman: Convert print statements to Python 3
Update all print statements to be functions, as required by Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -159,7 +159,6 @@ class TestFunctional(unittest.TestCase):
|
|||||||
os.remove(cc_file)
|
os.remove(cc_file)
|
||||||
|
|
||||||
lines = out[0].splitlines()
|
lines = out[0].splitlines()
|
||||||
#print '\n'.join(lines)
|
|
||||||
self.assertEqual('Cleaned %s patches' % len(series.commits), lines[0])
|
self.assertEqual('Cleaned %s patches' % len(series.commits), lines[0])
|
||||||
self.assertEqual('Change log missing for v2', lines[1])
|
self.assertEqual('Change log missing for v2', lines[1])
|
||||||
self.assertEqual('Change log missing for v3', lines[2])
|
self.assertEqual('Change log missing for v3', lines[2])
|
||||||
@@ -223,7 +222,6 @@ Simon Glass (2):
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
lines = open(cover_fname).read().splitlines()
|
lines = open(cover_fname).read().splitlines()
|
||||||
#print '\n'.join(lines)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
'Subject: [RFC PATCH v3 0/2] test: A test patch series',
|
'Subject: [RFC PATCH v3 0/2] test: A test patch series',
|
||||||
lines[3])
|
lines[3])
|
||||||
@@ -231,7 +229,6 @@ Simon Glass (2):
|
|||||||
|
|
||||||
for i, fname in enumerate(args):
|
for i, fname in enumerate(args):
|
||||||
lines = open(fname).read().splitlines()
|
lines = open(fname).read().splitlines()
|
||||||
#print '\n'.join(lines)
|
|
||||||
subject = [line for line in lines if line.startswith('Subject')]
|
subject = [line for line in lines if line.startswith('Subject')]
|
||||||
self.assertEqual('Subject: [RFC %d/%d]' % (i + 1, count),
|
self.assertEqual('Subject: [RFC %d/%d]' % (i + 1, count),
|
||||||
subject[0][:18])
|
subject[0][:18])
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
# Copyright (c) 2016 Google, Inc
|
# Copyright (c) 2016 Google, Inc
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
@@ -54,18 +56,18 @@ def RunTestCoverage(prog, filter_fname, exclude_list, build_dir, required=None):
|
|||||||
missing_list = required
|
missing_list = required
|
||||||
missing_list.difference_update(test_set)
|
missing_list.difference_update(test_set)
|
||||||
if missing_list:
|
if missing_list:
|
||||||
print 'Missing tests for %s' % (', '.join(missing_list))
|
print('Missing tests for %s' % (', '.join(missing_list)))
|
||||||
print stdout
|
print(stdout)
|
||||||
ok = False
|
ok = False
|
||||||
|
|
||||||
coverage = lines[-1].split(' ')[-1]
|
coverage = lines[-1].split(' ')[-1]
|
||||||
ok = True
|
ok = True
|
||||||
print coverage
|
print(coverage)
|
||||||
if coverage != '100%':
|
if coverage != '100%':
|
||||||
print stdout
|
print(stdout)
|
||||||
print("Type 'python-coverage html' to get a report in "
|
print("Type 'python-coverage html' to get a report in "
|
||||||
'htmlcov/index.html')
|
'htmlcov/index.html')
|
||||||
print 'Coverage error: %s, but should be 100%%' % coverage
|
print('Coverage error: %s, but should be 100%%' % coverage)
|
||||||
ok = False
|
ok = False
|
||||||
if not ok:
|
if not ok:
|
||||||
raise ValueError('Test coverage failure')
|
raise ValueError('Test coverage failure')
|
||||||
|
Reference in New Issue
Block a user