Avoid unnecessary comprehensions.

pull/70153/head
Matt Clay 4 years ago
parent 9bbde9d085
commit c67efe0bd1

@ -96,7 +96,7 @@ def get_raw_test_targets(args, test_path):
target_times[target_name] = target_runtime
return dict([(k, v) for k, v in sorted(target_times.items(), key=lambda i: i[1], reverse=True)])
return dict(sorted(target_times.items(), key=lambda i: i[1], reverse=True))
def print_test_runtime(target_times):

@ -455,7 +455,7 @@ def main():
if f not in features:
print('%s is not a valid feature' % f)
sys.exit(1)
features = [x for x in options.feature]
features = list(options.feature)
fdesc = {
'ini_host': 'host var inside the ini',

@ -33,7 +33,7 @@ from units.mock.path import mock_unfrackpath_noop
class TestPlayIterator(unittest.TestCase):
def test_host_state(self):
hs = HostState(blocks=[x for x in range(0, 10)])
hs = HostState(blocks=list(range(0, 10)))
hs.tasks_child_state = HostState(blocks=[0])
hs.rescue_child_state = HostState(blocks=[1])
hs.always_child_state = HostState(blocks=[2])

Loading…
Cancel
Save