diff --git a/hacking/shippable/rebalance.py b/hacking/shippable/rebalance.py index b262c9186cc..be12027c40d 100644 --- a/hacking/shippable/rebalance.py +++ b/hacking/shippable/rebalance.py @@ -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): diff --git a/test/integration/targets/var_precedence/ansible-var-precedence-check.py b/test/integration/targets/var_precedence/ansible-var-precedence-check.py index f19cd1c5ef7..e9b24adeff8 100755 --- a/test/integration/targets/var_precedence/ansible-var-precedence-check.py +++ b/test/integration/targets/var_precedence/ansible-var-precedence-check.py @@ -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', diff --git a/test/units/executor/test_play_iterator.py b/test/units/executor/test_play_iterator.py index 4ccfd69a96f..8091301d104 100644 --- a/test/units/executor/test_play_iterator.py +++ b/test/units/executor/test_play_iterator.py @@ -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])