core: clarify usage of classmethods in World class (#1449)

This commit is contained in:
el-u
2023-02-16 00:28:02 +01:00
committed by GitHub
parent b20be3ccec
commit ad4846cedd
13 changed files with 28 additions and 20 deletions

View File

@@ -22,3 +22,12 @@ class TestImplemented(unittest.TestCase):
for region in multiworld.regions:
for exit in region.exits:
self.assertEqual(exit.parent_region, region)
def testStageMethods(self):
"""Tests that worlds don't try to implement certain steps that are only ever called as stage."""
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden:
with self.subTest(game_name):
for method in ("assert_generate",):
self.assertFalse(hasattr(world_type, method),
f"{method} must be implemented as a @classmethod named stage_{method}.")