mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-07-29 01:00:46 -07:00
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:
@@ -6,12 +6,14 @@ from . import setup_solo_multiworld
|
||||
|
||||
|
||||
class TestWorldMemory(unittest.TestCase):
|
||||
world_relevant = True
|
||||
|
||||
def test_leak(self) -> None:
|
||||
"""Tests that worlds don't leak references to MultiWorld or themselves with default options."""
|
||||
import gc
|
||||
import weakref
|
||||
refs: dict[str, weakref.ReferenceType[MultiWorld]] = {}
|
||||
for game_name, world_type in AutoWorldRegister.world_types.items():
|
||||
for game_name, world_type in AutoWorldRegister.testable_worlds.items():
|
||||
with self.subTest("Game creation", game_name=game_name):
|
||||
weak = weakref.ref(setup_solo_multiworld(world_type))
|
||||
refs[game_name] = weak
|
||||
|
||||
Reference in New Issue
Block a user