mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-04-03 14:23:45 -07:00
Tests: now autoload tests from /worlds/*/test (#1318)
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
def load_tests(loader, standard_tests, pattern):
|
||||
import os
|
||||
import unittest
|
||||
from ..TestBase import file_path
|
||||
from worlds.AutoWorld import AutoWorldRegister
|
||||
|
||||
suite = unittest.TestSuite()
|
||||
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))
|
||||
return suite
|
||||
|
||||
Reference in New Issue
Block a user