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 1
1
"""Tests for worlds"""
2
2
import importlib .util
3
+ import operator
3
4
import os
4
5
from pathlib import Path
5
6
18
19
]
19
20
20
21
22
+ def fix_world (world ):
23
+ world .maps .sort (key = operator .attrgetter ("map_file" ))
24
+
25
+
21
26
@pytest .mark .parametrize ("world_test" , ALL_WORLD_TESTS )
22
27
def test_world_integration (world_test ):
23
28
# it's a PITA to import like this, don't do it
@@ -32,4 +37,11 @@ def test_world_integration(world_test):
32
37
33
38
casted_world = world .parse_world (raw_world_path )
34
39
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
+
35
47
assert casted_world == expected .EXPECTED
You can’t perform that action at this time.
0 commit comments