File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,15 @@ def _convert_select_pattern(pattern):
5757
5858
5959TESTPREFIX = "smoketests.tests."
60+
61+ def _iter_all_tests (suite_or_case ):
62+ """Yield all individual tests from possibly nested TestSuite structures."""
63+ if isinstance (suite_or_case , unittest .TestSuite ):
64+ for t in suite_or_case :
65+ yield from _iter_all_tests (t )
66+ else :
67+ yield suite_or_case
68+
6069def main ():
6170 tests = [fname .removesuffix (".py" ) for fname in os .listdir (TEST_DIR / "tests" ) if fname .endswith (".py" ) and fname != "__init__.py" ]
6271
@@ -108,8 +117,9 @@ def main():
108117 tests = loader .loadTestsFromNames (testlist )
109118 if args .list :
110119 print ("Selected tests:\n " )
111- for test in itertools .chain (* itertools .chain (* tests )):
112- print (f"{ test } " )
120+ for test in _iter_all_tests (tests ):
121+ name = test .id ()
122+ print (f"{ name } " )
113123 exit (0 )
114124
115125 if not args .no_build_cli :
You can’t perform that action at this time.
0 commit comments