Tests: Handle optional args for get_all_state patch (#5297)

* Make `use_cache` optional

* Pass all kwargs
This commit is contained in:
Duck
2025-08-08 16:24:19 -06:00
committed by GitHub
parent 17ccfdc266
commit ecb22642af

View File

@@ -48,13 +48,14 @@ class TestBase(unittest.TestCase):
original_get_all_state = multiworld.get_all_state original_get_all_state = multiworld.get_all_state
def patched_get_all_state(use_cache: bool, allow_partial_entrances: bool = False): def patched_get_all_state(use_cache: bool | None = None, allow_partial_entrances: bool = False,
**kwargs):
self.assertTrue(allow_partial_entrances, ( self.assertTrue(allow_partial_entrances, (
"Before the connect_entrances step finishes, other worlds might still have partial entrances. " "Before the connect_entrances step finishes, other worlds might still have partial entrances. "
"As such, any call to get_all_state must use allow_partial_entrances = True." "As such, any call to get_all_state must use allow_partial_entrances = True."
)) ))
return original_get_all_state(use_cache, allow_partial_entrances) return original_get_all_state(use_cache, allow_partial_entrances, **kwargs)
multiworld.get_all_state = patched_get_all_state multiworld.get_all_state = patched_get_all_state