Skip to content

Commit

Permalink
Sort while asserting
Browse files Browse the repository at this point in the history
  • Loading branch information
skrcode committed Sep 4, 2018
1 parent 4213218 commit 0431404
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spacy/tests/test_matcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# coding: utf-8
from __future__ import unicode_literals

from numpy import sort

from ..matcher import Matcher, PhraseMatcher, DependencyTreeMatcher
from .util import get_doc
from ..tokens import Doc
Expand Down Expand Up @@ -299,6 +301,6 @@ def test_dependency_tree_matcher_compile(dependency_tree_matcher):
def test_dependency_tree_matcher(dependency_tree_matcher,text,heads,deps):
doc = get_doc(dependency_tree_matcher.vocab,text.split(),heads=heads,deps=deps)
matches = dependency_tree_matcher(doc)
assert matches[0][1] == [1, 2, 3]
assert matches[1][1] == [2, 3, 4]
assert list(sort(matches[0][1])) == [1, 2, 3]
assert list(sort(matches[1][1])) == [2, 3, 4]

0 comments on commit 0431404

Please sign in to comment.