Tests: sort custom loaded tests (#1851)
This commit is contained in:
parent
c2884e9eb0
commit
fad0fe16f4
|
@ -8,7 +8,13 @@ def load_tests(loader, standard_tests, pattern):
|
|||
suite.addTests(standard_tests)
|
||||
folders = [os.path.join(os.path.split(world.__file__)[0], "test")
|
||||
for world in AutoWorldRegister.world_types.values()]
|
||||
for folder in folders:
|
||||
if os.path.exists(folder):
|
||||
suite.addTests(loader.discover(folder, top_level_dir=file_path))
|
||||
|
||||
all_tests = [
|
||||
test_case for folder in folders if os.path.exists(folder)
|
||||
for test_collection in loader.discover(folder, top_level_dir=file_path)
|
||||
for test_suite in test_collection
|
||||
for test_case in test_suite
|
||||
]
|
||||
|
||||
suite.addTests(sorted(all_tests, key=lambda test: test.__module__))
|
||||
return suite
|
||||
|
|
Loading…
Reference in New Issue