Package: python-whoosh / 2.7.4+git6-g9134ad92-5

0002-BF-TST-sort-suggestions-before-comparing-to-sorted-t.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From: Yaroslav Halchenko <debian@onerussian.com>
Date: Fri, 14 Jul 2017 17:18:48 -0400
Subject: BF(TST): sort suggestions before comparing to sorted target

---
 tests/test_spelling.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test_spelling.py b/tests/test_spelling.py
index ce5284f..7f2e40c 100644
--- a/tests/test_spelling.py
+++ b/tests/test_spelling.py
@@ -21,7 +21,8 @@ def test_list_corrector():
     typo = "reoction"
     sugs = list(corr.suggest(typo, maxdist=2))
     target = [w for w in _wordlist if levenshtein(typo, w) <= 2]
-    assert sugs == target
+    # _wordlist is sorted
+    assert sorted(sugs) == target
 
 
 def test_automaton():