Skip to content

Commit 347efac

Browse files
authored
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
1 parent b7b5bf5 commit 347efac

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

worlds/dlcquest/test/TestOptionsLong.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import unittest
12
from typing import Dict
23

34
from BaseClasses import MultiWorld
45
from Options import NamedRange
5-
from .option_names import options_to_include
6-
from .checks.world_checks import assert_can_win, assert_same_number_items_locations
76
from . import DLCQuestTestBase, setup_dlc_quest_solo_multiworld
7+
from .checks.world_checks import assert_can_win, assert_same_number_items_locations
8+
from .option_names import options_to_include
89

910

1011
def basic_checks(tester: DLCQuestTestBase, multiworld: MultiWorld):
@@ -38,6 +39,8 @@ def test_given_option_pair_when_generate_then_basic_checks(self):
3839
basic_checks(self, multiworld)
3940

4041
def test_given_option_truple_when_generate_then_basic_checks(self):
42+
if self.skip_long_tests:
43+
raise unittest.SkipTest("Long tests disabled")
4144
num_options = len(options_to_include)
4245
for option1_index in range(0, num_options):
4346
for option2_index in range(option1_index + 1, num_options):
@@ -59,6 +62,8 @@ def test_given_option_truple_when_generate_then_basic_checks(self):
5962
basic_checks(self, multiworld)
6063

6164
def test_given_option_quartet_when_generate_then_basic_checks(self):
65+
if self.skip_long_tests:
66+
raise unittest.SkipTest("Long tests disabled")
6267
num_options = len(options_to_include)
6368
for option1_index in range(0, num_options):
6469
for option2_index in range(option1_index + 1, num_options):

worlds/dlcquest/test/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1+
import os
2+
from argparse import Namespace
13
from typing import ClassVar
2-
34
from typing import Dict, FrozenSet, Tuple, Any
4-
from argparse import Namespace
55

66
from BaseClasses import MultiWorld
77
from test.bases import WorldTestBase
8-
from .. import DLCqworld
98
from test.general import gen_steps, setup_solo_multiworld as setup_base_solo_multiworld
109
from worlds.AutoWorld import call_all
10+
from .. import DLCqworld
1111

1212

1313
class DLCQuestTestBase(WorldTestBase):
1414
game = "DLCQuest"
1515
world: DLCqworld
1616
player: ClassVar[int] = 1
17+
# Set False to run tests that take long
18+
skip_long_tests: bool = True
19+
20+
@classmethod
21+
def setUpClass(cls) -> None:
22+
super().setUpClass()
23+
cls.skip_long_tests = not bool(os.environ.get("long"))
1724

1825
def world_setup(self, *args, **kwargs):
1926
super().world_setup(*args, **kwargs)

0 commit comments

Comments
 (0)