From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests()
Date: Tue, 28 Nov 2023 11:48:59 +0100 [thread overview]
Message-ID: <20231128105054.24317-5-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20231128105054.24317-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
The indent there is wrong, causing this warning:
scripts/test_list.py:1041:46: W0631: Using possibly undefined loop variable 'test' (undefined-loop-variable)
This issue also affects testlist generation, as tests will be
missing there.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 54 ++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 79b48813171b..3954e883ada3 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1038,43 +1038,43 @@ class TestList:
subtest_array += self.expand_subtest(fname, test_name, test, True)
- subtest_array.sort(key = lambda x : x.get('_summary_'))
+ subtest_array.sort(key = lambda x : x.get('_summary_'))
- for subtest in subtest_array:
- if self.__filter_subtest(self.doc[test], subtest, True):
- continue
+ for subtest in subtest_array:
+ if self.__filter_subtest(self.doc[test], subtest, True):
+ continue
- if sort_field:
- if sort_field in subtest:
- if expand:
- test_list = expand.split(subtest[sort_field])
+ if sort_field:
+ if sort_field in subtest:
+ if expand:
+ test_list = expand.split(subtest[sort_field])
- for test_elem in test_list:
- if test_elem not in subtests:
- subtests[test_elem] = []
- if order:
- subtests[test_elem].append((subtest["_summary_"], test_list))
- else:
- subtests[test_elem].append(subtest["_summary_"])
+ for test_elem in test_list:
+ if test_elem not in subtests:
+ subtests[test_elem] = []
+ if order:
+ subtests[test_elem].append((subtest["_summary_"], test_list))
+ else:
+ subtests[test_elem].append(subtest["_summary_"])
+ else:
+ if subtest[sort_field] not in subtests:
+ subtests[subtest[sort_field]] = []
+ if order:
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
+ else:
+ subtests[subtest[sort_field]].append(subtest["_summary_"])
else:
- if subtest[sort_field] not in subtests:
- subtests[subtest[sort_field]] = []
- if order:
- subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
- else:
- subtests[subtest[sort_field]].append(subtest["_summary_"])
+ if order:
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
+ else:
+ subtests[""].append(subtest["_summary_"])
+
else:
if order:
subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
subtests[""].append(subtest["_summary_"])
- else:
- if order:
- subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
- else:
- subtests[""].append(subtest["_summary_"])
-
if order:
for group, tests in subtests.items():
prefix_tests = []
--
2.42.0
next prev parent reply other threads:[~2023-11-28 10:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better expand subtests Mauro Carvalho Chehab
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description Mauro Carvalho Chehab
2023-11-28 15:51 ` Kamil Konieczny
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues Mauro Carvalho Chehab
2023-11-28 15:44 ` Kamil Konieczny
2023-11-28 10:48 ` Mauro Carvalho Chehab [this message]
2023-11-28 15:57 ` [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests() Kamil Konieczny
2023-11-28 10:49 ` [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function Mauro Carvalho Chehab
2023-11-28 15:59 ` Kamil Konieczny
2023-11-28 11:59 ` [igt-dev] ✓ CI.xeBAT: success for Do dome cleanups at IGT doc tools Patchwork
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=20231128105054.24317-5-mauro.chehab@linux.intel.com \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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