From 20e93c46864ed0ed4c760cf675db0a45a9220325 Mon Sep 17 00:00:00 2001 From: gecong1973 Date: Mon, 28 Nov 2016 10:19:14 +0800 Subject: [PATCH] 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: I7844f6425787388fa37b85b3c0f305b34cddc0fa --- fuel_plugin/testing/tests/integration/test_models_methods.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fuel_plugin/testing/tests/integration/test_models_methods.py b/fuel_plugin/testing/tests/integration/test_models_methods.py index cb671c69..4ef4934a 100644 --- a/fuel_plugin/testing/tests/integration/test_models_methods.py +++ b/fuel_plugin/testing/tests/integration/test_models_methods.py @@ -13,7 +13,6 @@ # under the License. import datetime -import six import mock @@ -60,7 +59,7 @@ class TestModelTestMethods(base.BaseIntegrationTest): .first() def check_model_obj_attrs(self, obj, attrs): - for attr_name, attr_val in six.iteritems(attrs): + for attr_name, attr_val in attrs.items(): self.assertEqual(attr_val, getattr(obj, attr_name)) def test_add_result(self):