This avoids the second loop over the cpus, and reuses some of the variables.
Signed-off-by: Cleber Rosa <cr...@redhat.com> --- tests/acceptance/cpu_queries.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py index 9cd6f553ff..54aa310fb8 100644 --- a/tests/acceptance/cpu_queries.py +++ b/tests/acceptance/cpu_queries.py @@ -25,9 +25,8 @@ class QueryCPUModelExpansion(Test): cpus = self.vm.command('query-cpu-definitions') for c in cpus: - self.assertNotIn('', c['unavailable-features'], c['name']) - - for c in cpus: - model = {'name': c['name']} - e = self.vm.command('query-cpu-model-expansion', model=model, type='full') - self.assertEquals(e['model']['name'], c['name']) + model_name = c['name'] + self.assertNotIn('', c['unavailable-features'], model_name) + e = self.vm.command('query-cpu-model-expansion', + model={'name': model_name}, type='full') + self.assertEquals(e['model']['name'], model_name) -- 2.21.0