From: Cleber Rosa <crosa@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Willian Rampazzo" <wrampazz@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH 4/4] tests/acceptance/cpu_queries.py: minor optmizations
Date: Tue, 10 Sep 2019 20:42:04 -0400 [thread overview]
Message-ID: <20190911004204.29286-5-crosa@redhat.com> (raw)
In-Reply-To: <20190911004204.29286-1-crosa@redhat.com>
This avoids the second loop over the cpus, and reuses some of the
variables.
Signed-off-by: Cleber Rosa <crosa@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
prev parent reply other threads:[~2019-09-11 0:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 0:42 [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements Cleber Rosa
2019-09-11 0:42 ` [Qemu-devel] [PATCH 1/4] tests/acceptance/cpu_queries.py: cleanups Cleber Rosa
2019-09-11 0:42 ` [Qemu-devel] [PATCH 2/4] tests/acceptance/cpu_queries.py: tag test as x86_64 specific Cleber Rosa
2019-09-11 0:42 ` [Qemu-devel] [PATCH 3/4] tests/acceptance/cpu_queries.py: add machine tag Cleber Rosa
2019-09-11 0:42 ` Cleber Rosa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190911004204.29286-5-crosa@redhat.com \
--to=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@redhat.com \
--cc=wrampazz@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).