From patchwork Wed Sep 11 00:42:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1160586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46SjsX3RXYz9sCJ for ; Wed, 11 Sep 2019 10:47:12 +1000 (AEST) Received: from localhost ([::1]:45694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7qms-00037G-AB for incoming@patchwork.ozlabs.org; Tue, 10 Sep 2019 20:47:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46364) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7qiA-0007Xx-SQ for qemu-devel@nongnu.org; Tue, 10 Sep 2019 20:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7qi9-00081F-PP for qemu-devel@nongnu.org; Tue, 10 Sep 2019 20:42:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41722) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7qi9-00080y-Ki for qemu-devel@nongnu.org; Tue, 10 Sep 2019 20:42:17 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 017453174640 for ; Wed, 11 Sep 2019 00:42:17 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-121-171.rdu2.redhat.com [10.10.121.171]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CA3760166; Wed, 11 Sep 2019 00:42:16 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2019 20:42:04 -0400 Message-Id: <20190911004204.29286-5-crosa@redhat.com> In-Reply-To: <20190911004204.29286-1-crosa@redhat.com> References: <20190911004204.29286-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 11 Sep 2019 00:42:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] tests/acceptance/cpu_queries.py: minor optmizations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Willian Rampazzo , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , Eduardo Habkost , Wainer dos Santos Moschetta , Cleber Rosa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This avoids the second loop over the cpus, and reuses some of the variables. Signed-off-by: Cleber Rosa --- 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)