Files
Grinch-AP/worlds/stardew_valley/test/rules/TestTravelingMerchant.py
agilbert1412 1bd44e1e35 Stardew Valley: Fixed Traveling merchant flaky test (#5434)
* - Made the traveling cart test not be flaky due to worlds caching

# Conflicts:
#	worlds/stardew_valley/rules.py

* - Made the traveling merchant test less flaky

# Conflicts:
#	worlds/stardew_valley/test/rules/TestTravelingMerchant.py
2025-09-21 18:58:15 +02:00

29 lines
1.4 KiB
Python

from ..bases import SVTestBase
from ... import SeasonRandomization, EntranceRandomization
from ...locations import location_table, LocationTags
class TestTravelingMerchant(SVTestBase):
options = {
SeasonRandomization: SeasonRandomization.option_randomized_not_winter,
EntranceRandomization: EntranceRandomization.option_disabled,
}
def test_purchase_from_traveling_merchant_requires_money(self):
traveling_merchant_location_names = [l for l in self.get_real_location_names() if LocationTags.TRAVELING_MERCHANT in location_table[l].tags]
for traveling_merchant_day in ["Traveling Merchant: Sunday", "Traveling Merchant: Monday", "Traveling Merchant: Tuesday",
"Traveling Merchant: Wednesday", "Traveling Merchant: Thursday", "Traveling Merchant: Friday",
"Traveling Merchant: Saturday"]:
self.collect(traveling_merchant_day)
for location_name in traveling_merchant_location_names:
location = self.multiworld.get_location(location_name, 1)
self.assert_cannot_reach_location(location, self.multiworld.state)
self.collect("Shipping Bin")
for location_name in traveling_merchant_location_names:
location = self.multiworld.get_location(location_name, 1)
self.assert_can_reach_location(location, self.multiworld.state)