summaryrefslogtreecommitdiff
path: root/functionaltests
diff options
context:
space:
mode:
authorM V P Nitesh <m.nitesh@nectechnologies.in>2017-03-30 18:36:25 +0530
committerM V P Nitesh <m.nitesh@nectechnologies.in>2017-03-30 18:37:24 +0530
commit978d3b43f3feac5a6013a1deec3db290fef71225 (patch)
tree7c18b6cb486a93b5a1da84ad131799663b6f27ba /functionaltests
parentf008a7b0c1124a289ff0c36eb5a816f221a32b35 (diff)
downloadpython-barbicanclient-978d3b43f3feac5a6013a1deec3db290fef71225.tar.gz
Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I093160f746f346871c136043a8fa48c9491fdc1a
Diffstat (limited to 'functionaltests')
-rw-r--r--functionaltests/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/functionaltests/utils.py b/functionaltests/utils.py
index 34a4251..3e1c094 100644
--- a/functionaltests/utils.py
+++ b/functionaltests/utils.py
@@ -22,6 +22,7 @@ import oslotest.base as oslotest
import six
import six.moves.urllib.parse as urlparse
+
class BaseTestCase(oslotest.BaseTestCase):
def setUp(self):
super(BaseTestCase, self).setUp()
@@ -67,7 +68,7 @@ def process_parameterized_function(name, func_obj, build_data):
to_remove = []
to_add = []
- for subtest_name, params in six.iteritems(build_data):
+ for subtest_name, params in build_data.items():
# Build new test function
func_name = '{0}_{1}'.format(name, subtest_name)
new_func = construct_new_test_function(func_obj, func_name, params)
@@ -89,7 +90,7 @@ def parameterized_test_case(cls):
"""
tests_to_remove = []
tests_to_add = []
- for key, val in six.iteritems(vars(cls)):
+ for key, val in vars(cls).items():
# Only process tests with build data on them
if key.startswith('test_') and val.__dict__.get('build_data'):
to_remove, to_add = process_parameterized_function(