Skip to content

Commit

Permalink
remove weird bytes from stability tests here as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouramie committed Nov 23, 2024
1 parent 1ee4332 commit a1d72f6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions worlds/stardew_valley/test/stability/TestStability.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from BaseClasses import get_seed
from .. import SVTestCase

# There seems to be 4 bytes that appear at random at the end of the output, breaking the json... I don't know where they came from.
BYTES_TO_REMOVE = 4

# <function Location.<lambda> at 0x102ca98a0>
lambda_regex = re.compile(r"^<function Location\.<lambda> at (.*)>$")
# Python 3.10.2\r\n
Expand All @@ -29,8 +26,8 @@ def test_all_locations_and_items_are_the_same_between_two_generations(self):
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)])

result_a = json.loads(output_a[:-BYTES_TO_REMOVE])
result_b = json.loads(output_b[:-BYTES_TO_REMOVE])
result_a = json.loads(output_a)
result_b = json.loads(output_b)

for i, ((room_a, bundles_a), (room_b, bundles_b)) in enumerate(zip(result_a["bundles"].items(), result_b["bundles"].items())):
self.assertEqual(room_a, room_b, f"Bundle rooms at index {i} is different between both executions. Seed={seed}")
Expand Down

0 comments on commit a1d72f6

Please sign in to comment.