From 9d4f5b9a4e5258a26351a0c2613cae8e04169f2c Mon Sep 17 00:00:00 2001 From: Alex Gilbert Date: Sun, 28 Jan 2024 23:29:01 -0500 Subject: [PATCH] - Changed imports to be relative - Moved test file - Removed hard coded seed from stability test - Removed unused initialization of the number_progression_items variable --- worlds/stardew_valley/__init__.py | 1 - .../stardew_valley/test/{ => long}/TestRandomWorlds.py | 10 +++++----- worlds/stardew_valley/test/stability/TestStability.py | 4 +++- 3 files changed, 8 insertions(+), 7 deletions(-) rename worlds/stardew_valley/test/{ => long}/TestRandomWorlds.py (86%) diff --git a/worlds/stardew_valley/__init__.py b/worlds/stardew_valley/__init__.py index dc779503b1b1..74c4efb60f0f 100644 --- a/worlds/stardew_valley/__init__.py +++ b/worlds/stardew_valley/__init__.py @@ -140,7 +140,6 @@ def register_indirect_connections(self, world_regions, world_entrances): self.multiworld.register_indirect_condition(walnut_room, world_entrances[EntranceName.enter_dangerous_skull_cavern]) def create_items(self): - self.total_progression_items = 0 self.precollect_starting_season() items_to_exclude = [excluded_items for excluded_items in self.multiworld.precollected_items[self.player] diff --git a/worlds/stardew_valley/test/TestRandomWorlds.py b/worlds/stardew_valley/test/long/TestRandomWorlds.py similarity index 86% rename from worlds/stardew_valley/test/TestRandomWorlds.py rename to worlds/stardew_valley/test/long/TestRandomWorlds.py index db5e0278c06f..62ad7d7c1cc1 100644 --- a/worlds/stardew_valley/test/TestRandomWorlds.py +++ b/worlds/stardew_valley/test/long/TestRandomWorlds.py @@ -3,12 +3,12 @@ from BaseClasses import MultiWorld from Options import NamedRange, Range -from worlds.stardew_valley.test import setup_solo_multiworld, SVTestCase -from worlds.stardew_valley.test.checks.goal_checks import assert_goal_world_is_valid -from worlds.stardew_valley.test.checks.option_checks import assert_can_reach_island_if_should, assert_cropsanity_same_number_items_and_locations, \ +from .. import setup_solo_multiworld, SVTestCase +from ..checks.goal_checks import assert_goal_world_is_valid +from ..checks.option_checks import assert_can_reach_island_if_should, assert_cropsanity_same_number_items_and_locations, \ assert_festivals_give_access_to_deluxe_scarecrow, assert_has_festival_recipes -from worlds.stardew_valley.test.checks.world_checks import assert_same_number_items_locations, assert_victory_exists -from worlds.stardew_valley.test.long.option_names import options_to_include +from ..checks.world_checks import assert_same_number_items_locations, assert_victory_exists +from .option_names import options_to_include def get_option_choices(option) -> Dict[str, int]: diff --git a/worlds/stardew_valley/test/stability/TestStability.py b/worlds/stardew_valley/test/stability/TestStability.py index 7710b1788daa..978b58a117ae 100644 --- a/worlds/stardew_valley/test/stability/TestStability.py +++ b/worlds/stardew_valley/test/stability/TestStability.py @@ -3,6 +3,7 @@ import subprocess import sys import unittest +from random import random from BaseClasses import get_seed @@ -17,7 +18,8 @@ class TestGenerationIsStable(unittest.TestCase): """ def test_all_locations_and_items_are_the_same_between_two_generations(self): - seed = get_seed(33778671150797368040) + # seed = get_seed(33778671150797368040) # troubleshooting seed + seed = random.randrange(sys.maxsize) output_a = subprocess.check_output([sys.executable, '-m', 'worlds.stardew_valley.test.stability.StabilityOutputScript', '--seed', str(seed)]) output_b = subprocess.check_output([sys.executable, '-m', 'worlds.stardew_valley.test.stability.StabilityOutputScript', '--seed', str(seed)])