Codebase list python-castellan / 067c765
Replacing six.iteritems() with .items() 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 be more readable. For more information, please refer to [1][2]. [1] https://wiki.openstack.org/wiki/Python3#Common_patterns [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: Ib1a5c6c4770d052d3e1c87eda037126442cb732c rajat29 authored 6 years ago ChangBo Guo(gcb) committed 6 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3737 argdefs=six.get_function_defaults(original_func)
3838 )
3939
40 for key, val in six.iteritems(original_func.__dict__):
40 for key, val in original_func.__dict__.items():
4141 if key != 'build_data':
4242 new_func.__dict__[key] = val
4343
6060 to_remove = []
6161 to_add = []
6262
63 for subtest_name, params in six.iteritems(build_data):
63 for subtest_name, params in build_data.items():
6464 # Build new test function
6565 func_name = '{0}_{1}'.format(name, subtest_name)
6666 new_func = construct_new_test_function(func_obj, func_name, params)
8282 """
8383 tests_to_remove = []
8484 tests_to_add = []
85 for key, val in six.iteritems(vars(cls)):
85 for key, val in vars(cls).items():
8686 # Only process tests with build data on them
8787 if key.startswith('test_') and val.__dict__.get('build_data'):
8888 to_remove, to_add = process_parameterized_function(