Skip to content

Commit 592173a

Browse files
committed
fixed test failing intermittently on old Python versions
it relied on dict key ordering which wasn't guaranteed on Python < 3.7
1 parent c0e5def commit 592173a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

larray/inout/xw_reporting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def set_item_default_size(self, kind, width=None, height=None):
134134
"Please provide one for at least 'width' or 'heigth'")
135135
if kind not in self.default_items_size:
136136
raise ValueError("Item type {} is not registered. Please choose in "
137-
"list {}".format(kind, list(self.default_items_size.keys())))
137+
"list {}".format(kind, sorted(self.default_items_size.keys())))
138138
if width is None:
139139
width = self.default_items_size[kind].width
140140
if height is None:

larray/tests/test_excel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def test_excel_report_arrays():
368368
# 1) pass a not registered kind of item
369369
item_type = 'unknown_item'
370370
msg = "Item type {} is not registered. Please choose in " \
371-
"list ['title', 'graph']".format(item_type)
371+
"list ['graph', 'title']".format(item_type)
372372
with pytest.raises(ValueError, match=re.escape(msg)):
373373
sheet_graphs.set_item_default_size(item_type, width, height)
374374
# 2) update default size for graphs

0 commit comments

Comments
 (0)