Skip to content

Commit c9d1677

Browse files
tests: future proof one test
1 parent 4c74dce commit c9d1677

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

tests/test_present.py

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
This module contains some tests for the Presentation class.
1313
"""
1414

15-
from typing import List, Union
15+
# pylint: disable=fixme
16+
1617
from datetime import timedelta
18+
from typing import List, Union
1719

1820
import pytest
19-
20-
from libsemigroups_pybind11 import (
21-
Presentation,
22-
presentation,
23-
ReportGuard,
24-
)
21+
from libsemigroups_pybind11 import Presentation, ReportGuard, presentation
2522

2623
###############################################################################
2724
# Helper functions
@@ -214,18 +211,33 @@ def check_sort_rules(W):
214211
presentation.add_rule(p, W([1, 2, 1]), W([0]))
215212
p.alphabet_from_rules()
216213
presentation.sort_rules(p)
217-
assert p.rules == [
218-
W([1, 1]),
219-
W([1, 2, 1]),
220-
W([1, 2, 1]),
221-
W([1, 1, 2, 1]),
222-
W([1, 2, 1]),
223-
W([0]),
224-
W([0, 1, 2, 1]),
225-
W([1, 2, 1]),
226-
W([1, 1, 2, 1]),
227-
W([1, 1]),
228-
]
214+
# TODO when we require libsemigroups v2.3.0 remove the first clause here!
215+
assert p.rules in (
216+
[
217+
W([1, 1]),
218+
W([1, 2, 1]),
219+
W([1, 2, 1]),
220+
W([1, 1, 2, 1]),
221+
W([1, 2, 1]),
222+
W([0]),
223+
W([0, 1, 2, 1]),
224+
W([1, 2, 1]),
225+
W([1, 1, 2, 1]),
226+
W([1, 1]),
227+
],
228+
[
229+
W([1, 2, 1]),
230+
W([0]),
231+
W([1, 1]),
232+
W([1, 2, 1]),
233+
W([1, 1, 2, 1]),
234+
W([1, 1]),
235+
W([0, 1, 2, 1]),
236+
W([1, 2, 1]),
237+
W([1, 2, 1]),
238+
W([1, 1, 2, 1]),
239+
],
240+
)
229241

230242

231243
def check_longest_common_subword(W):

0 commit comments

Comments
 (0)