Core: Allow running unit tests scoped to specific worlds (#6290)

This allows the unit tests to be run on specific worlds only, it works by using an environment variable AP_TEST_WORLDS which is a comma separated list of world directories.
This commit is contained in:
James White
2026-07-17 19:01:28 +01:00
committed by GitHub
parent c311685064
commit 9c80dc6257
31 changed files with 194 additions and 59 deletions
+4 -2
View File
@@ -9,12 +9,14 @@ from worlds.AutoWorld import AutoWorldRegister
class TestDocs(unittest.TestCase):
world_relevant = True
@classmethod
def setUpClass(cls) -> None:
WebHost.copy_tutorials_files_to_static()
def test_has_tutorial(self):
for game_name, world_type in AutoWorldRegister.world_types.items():
for game_name, world_type in AutoWorldRegister.testable_worlds.items():
if not world_type.hidden:
with self.subTest(game_name):
tutorials = world_type.web.tutorials
@@ -29,7 +31,7 @@ class TestDocs(unittest.TestCase):
)
def test_has_game_info(self):
for game_name, world_type in AutoWorldRegister.world_types.items():
for game_name, world_type in AutoWorldRegister.testable_worlds.items():
if not world_type.hidden:
safe_name = secure_filename(game_name)
target_path = Utils.local_path("WebHostLib", "static", "generated", "docs", safe_name)