Skip to content

Commit 52978e2

Browse files
Berserker66FlySniper
authored andcommitted
Tests: sort custom loaded tests (ArchipelagoMW#1851)
1 parent bb2094c commit 52978e2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/worlds/__init__.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ def load_tests(loader, standard_tests, pattern):
88
suite.addTests(standard_tests)
99
folders = [os.path.join(os.path.split(world.__file__)[0], "test")
1010
for world in AutoWorldRegister.world_types.values()]
11-
for folder in folders:
12-
if os.path.exists(folder):
13-
suite.addTests(loader.discover(folder, top_level_dir=file_path))
11+
12+
all_tests = [
13+
test_case for folder in folders if os.path.exists(folder)
14+
for test_collection in loader.discover(folder, top_level_dir=file_path)
15+
for test_suite in test_collection
16+
for test_case in test_suite
17+
]
18+
19+
suite.addTests(sorted(all_tests, key=lambda test: test.__module__))
1420
return suite

0 commit comments

Comments
 (0)