mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
DLC Quest - Skip two long tests in the main pipeline (#4862)
* - Set up the two long tests to only run when the specific config is active * Apply Black Sliver's suggestion
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
|
import unittest
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from BaseClasses import MultiWorld
|
from BaseClasses import MultiWorld
|
||||||
from Options import NamedRange
|
from Options import NamedRange
|
||||||
from .option_names import options_to_include
|
|
||||||
from .checks.world_checks import assert_can_win, assert_same_number_items_locations
|
|
||||||
from . import DLCQuestTestBase, setup_dlc_quest_solo_multiworld
|
from . import DLCQuestTestBase, setup_dlc_quest_solo_multiworld
|
||||||
|
from .checks.world_checks import assert_can_win, assert_same_number_items_locations
|
||||||
|
from .option_names import options_to_include
|
||||||
|
|
||||||
|
|
||||||
def basic_checks(tester: DLCQuestTestBase, multiworld: MultiWorld):
|
def basic_checks(tester: DLCQuestTestBase, multiworld: MultiWorld):
|
||||||
@@ -38,6 +39,8 @@ class TestGenerateDynamicOptions(DLCQuestTestBase):
|
|||||||
basic_checks(self, multiworld)
|
basic_checks(self, multiworld)
|
||||||
|
|
||||||
def test_given_option_truple_when_generate_then_basic_checks(self):
|
def test_given_option_truple_when_generate_then_basic_checks(self):
|
||||||
|
if self.skip_long_tests:
|
||||||
|
raise unittest.SkipTest("Long tests disabled")
|
||||||
num_options = len(options_to_include)
|
num_options = len(options_to_include)
|
||||||
for option1_index in range(0, num_options):
|
for option1_index in range(0, num_options):
|
||||||
for option2_index in range(option1_index + 1, num_options):
|
for option2_index in range(option1_index + 1, num_options):
|
||||||
@@ -59,6 +62,8 @@ class TestGenerateDynamicOptions(DLCQuestTestBase):
|
|||||||
basic_checks(self, multiworld)
|
basic_checks(self, multiworld)
|
||||||
|
|
||||||
def test_given_option_quartet_when_generate_then_basic_checks(self):
|
def test_given_option_quartet_when_generate_then_basic_checks(self):
|
||||||
|
if self.skip_long_tests:
|
||||||
|
raise unittest.SkipTest("Long tests disabled")
|
||||||
num_options = len(options_to_include)
|
num_options = len(options_to_include)
|
||||||
for option1_index in range(0, num_options):
|
for option1_index in range(0, num_options):
|
||||||
for option2_index in range(option1_index + 1, num_options):
|
for option2_index in range(option1_index + 1, num_options):
|
||||||
|
@@ -1,19 +1,26 @@
|
|||||||
from typing import ClassVar
|
import os
|
||||||
|
|
||||||
from typing import Dict, FrozenSet, Tuple, Any
|
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
|
from typing import ClassVar
|
||||||
|
from typing import Dict, FrozenSet, Tuple, Any
|
||||||
|
|
||||||
from BaseClasses import MultiWorld
|
from BaseClasses import MultiWorld
|
||||||
from test.bases import WorldTestBase
|
from test.bases import WorldTestBase
|
||||||
from .. import DLCqworld
|
|
||||||
from test.general import gen_steps, setup_solo_multiworld as setup_base_solo_multiworld
|
from test.general import gen_steps, setup_solo_multiworld as setup_base_solo_multiworld
|
||||||
from worlds.AutoWorld import call_all
|
from worlds.AutoWorld import call_all
|
||||||
|
from .. import DLCqworld
|
||||||
|
|
||||||
|
|
||||||
class DLCQuestTestBase(WorldTestBase):
|
class DLCQuestTestBase(WorldTestBase):
|
||||||
game = "DLCQuest"
|
game = "DLCQuest"
|
||||||
world: DLCqworld
|
world: DLCqworld
|
||||||
player: ClassVar[int] = 1
|
player: ClassVar[int] = 1
|
||||||
|
# Set False to run tests that take long
|
||||||
|
skip_long_tests: bool = True
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls) -> None:
|
||||||
|
super().setUpClass()
|
||||||
|
cls.skip_long_tests = not bool(os.environ.get("long"))
|
||||||
|
|
||||||
def world_setup(self, *args, **kwargs):
|
def world_setup(self, *args, **kwargs):
|
||||||
super().world_setup(*args, **kwargs)
|
super().world_setup(*args, **kwargs)
|
||||||
|
Reference in New Issue
Block a user