autotest: fix --list-subtests

This commit is contained in:
Peter Barker 2023-03-09 12:47:31 +11:00 committed by Peter Barker
parent 3a5567265a
commit db4f974c64

View File

@ -810,11 +810,9 @@ def list_subtests():
subtests = tester.tests()
sorted_list = []
for subtest in subtests:
if type(subtest) is tuple:
(name, description, function) = subtest
sorted_list.append([name, description])
else:
sorted_list.append([subtest.name, subtest.description])
if str(type(subtest)) == "<class 'method'>":
subtest = Test(subtest)
sorted_list.append([subtest.name, subtest.description])
sorted_list.sort()
print("%s:" % vehicle)