File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11"""Tests for worlds"""
22import importlib .util
3+ import operator
34import os
45from pathlib import Path
56
1819]
1920
2021
22+ def fix_world (world ):
23+ world .maps .sort (key = operator .attrgetter ("map_file" ))
24+
25+
2126@pytest .mark .parametrize ("world_test" , ALL_WORLD_TESTS )
2227def test_world_integration (world_test ):
2328 # it's a PITA to import like this, don't do it
@@ -32,4 +37,11 @@ def test_world_integration(world_test):
3237
3338 casted_world = world .parse_world (raw_world_path )
3439
40+ # These fix calls sort the map list in the world by the map_file
41+ # attribute because we don't actually care about the order of the list
42+ # and it can vary between runs, but pytest will fail if it is
43+ # not in the same order.
44+ fix_world (casted_world )
45+ fix_world (expected .EXPECTED )
46+
3547 assert casted_world == expected .EXPECTED
You can’t perform that action at this time.
0 commit comments