diff options
author | 2017-03-11 19:12:43 +0100 | |
---|---|---|
committer | 2017-03-12 17:47:53 +0100 | |
commit | d194f59939de8e9956e0d040266e3da269879a01 (patch) | |
tree | d6518b7baea61d2d00922b9af64c45d86023609b /tools/run_tests/python_utils | |
parent | 0b7bd20de4f0d219c399ef8c01c05026bf12da5d (diff) |
Make testing scripts python3.x compatible
Update run_tests/*.py to use six based isomorphisms and print function
from __future__ module.
Diffstat (limited to 'tools/run_tests/python_utils')
-rw-r--r-- | tools/run_tests/python_utils/filter_pull_request_tests.py | 5 | ||||
-rw-r--r-- | tools/run_tests/python_utils/report_utils.py | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/run_tests/python_utils/filter_pull_request_tests.py b/tools/run_tests/python_utils/filter_pull_request_tests.py index 3734f025d5..041e349162 100644 --- a/tools/run_tests/python_utils/filter_pull_request_tests.py +++ b/tools/run_tests/python_utils/filter_pull_request_tests.py @@ -30,7 +30,10 @@ """Filter out tests based on file differences compared to merge target branch""" +from __future__ import print_function + import re +import six from subprocess import check_output @@ -125,7 +128,7 @@ _WHITELIST_DICT = { } # Add all triggers to their respective test suites -for trigger, test_suites in _WHITELIST_DICT.iteritems(): +for trigger, test_suites in six.iteritems(_WHITELIST_DICT): for test_suite in test_suites: test_suite.add_trigger(trigger) diff --git a/tools/run_tests/python_utils/report_utils.py b/tools/run_tests/python_utils/report_utils.py index 9dad60408f..131772f55f 100644 --- a/tools/run_tests/python_utils/report_utils.py +++ b/tools/run_tests/python_utils/report_utils.py @@ -40,6 +40,7 @@ except (ImportError): import os import string import xml.etree.cElementTree as ET +import six def _filter_msg(msg, output_format): @@ -63,7 +64,7 @@ def render_junit_xml_report(resultset, xml_report, suite_package='grpc', root = ET.Element('testsuites') testsuite = ET.SubElement(root, 'testsuite', id='1', package=suite_package, name=suite_name) - for shortname, results in resultset.iteritems(): + for shortname, results in six.iteritems(resultset): for result in results: xml_test = ET.SubElement(testsuite, 'testcase', name=shortname) if result.elapsed_time: |