Browse Source

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
gecong1973 2 years ago
parent
commit
20e93c4686
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      fuel_plugin/testing/tests/integration/test_models_methods.py

+ 1
- 2
fuel_plugin/testing/tests/integration/test_models_methods.py View File

@@ -13,7 +13,6 @@
13 13
 #    under the License.
14 14
 
15 15
 import datetime
16
-import six
17 16
 
18 17
 import mock
19 18
 
@@ -60,7 +59,7 @@ class TestModelTestMethods(base.BaseIntegrationTest):
60 59
             .first()
61 60
 
62 61
     def check_model_obj_attrs(self, obj, attrs):
63
-        for attr_name, attr_val in six.iteritems(attrs):
62
+        for attr_name, attr_val in attrs.items():
64 63
             self.assertEqual(attr_val, getattr(obj, attr_name))
65 64
 
66 65
     def test_add_result(self):

Loading…
Cancel
Save