Tidy up tests

This commit is contained in:
Ines Montani 2019-02-24 14:11:23 +01:00
parent 2982f82934
commit 723e27cb8c
3 changed files with 3 additions and 7 deletions

View File

@ -1,7 +1,6 @@
# coding: utf8
from __future__ import unicode_literals
import pytest
from spacy.matcher import Matcher
from spacy.tokens import Token, Doc
@ -28,7 +27,7 @@ def test_issue1971(en_vocab):
def test_issue_1971_2(en_vocab):
matcher = Matcher(en_vocab)
pattern1 = [{"ORTH": "EUR", "LOWER": {"IN": ["eur"]}}, {"LIKE_NUM": True}]
pattern2 = [{"LIKE_NUM": True}, {"ORTH": "EUR"}] #{"IN": ["EUR"]}}]
pattern2 = [{"LIKE_NUM": True}, {"ORTH": "EUR"}] # {"IN": ["EUR"]}}]
doc = Doc(en_vocab, words=["EUR", "10", "is", "10", "EUR"])
matcher.add("TEST1", None, pattern1, pattern2)
matches = matcher(doc)
@ -59,6 +58,5 @@ def test_issue_1971_4(en_vocab):
pattern = [{"_": {"ext_a": "str_a", "ext_b": "str_b"}}] * 3
matcher.add("TEST", None, pattern)
matches = matcher(doc)
# Interesting: uncommenting this causes a segmentation fault, so there's
# definitely something going on here
# assert len(matches) == 1
# Uncommenting this caused a segmentation fault
assert len(matches) == 1

View File

@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import pytest
import numpy
from spacy import displacy

View File

@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.lang.en import English