mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 12:06:08 +00:00
utils/diff: fix diff_interrupt_files on Python 2
During Python 3 migration, the izip call inside diff_interrupt_files has been replaced with a zip call (zip returning an iterator in Python 3). Import zip from builtins to ensure that it also produces an iterator in Python 2. Also fix the associated unit test by importing the correct function.
This commit is contained in:
parent
d64ab6f099
commit
64f9cf79e4
@ -22,7 +22,7 @@ from unittest import TestCase
|
|||||||
|
|
||||||
from nose.tools import assert_equal
|
from nose.tools import assert_equal
|
||||||
|
|
||||||
from wa.instruments.misc import _diff_interrupt_files
|
from wa.utils.diff import diff_interrupt_files
|
||||||
|
|
||||||
|
|
||||||
class InterruptDiffTest(TestCase):
|
class InterruptDiffTest(TestCase):
|
||||||
@ -34,7 +34,7 @@ class InterruptDiffTest(TestCase):
|
|||||||
expected_result_file = os.path.join(file_dir, 'result')
|
expected_result_file = os.path.join(file_dir, 'result')
|
||||||
output_file = tempfile.mktemp()
|
output_file = tempfile.mktemp()
|
||||||
|
|
||||||
_diff_interrupt_files(before_file, after_file, output_file)
|
diff_interrupt_files(before_file, after_file, output_file)
|
||||||
with open(output_file) as fh:
|
with open(output_file) as fh:
|
||||||
output_diff = fh.read()
|
output_diff = fh.read()
|
||||||
with open(expected_result_file) as fh:
|
with open(expected_result_file) as fh:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from builtins import zip
|
||||||
from future.moves.itertools import zip_longest
|
from future.moves.itertools import zip_longest
|
||||||
|
|
||||||
from wa.utils.misc import as_relative, diff_tokens, write_table
|
from wa.utils.misc import as_relative, diff_tokens, write_table
|
||||||
|
Loading…
x
Reference in New Issue
Block a user