Unit test for Issue 3879 (#4153)

* failing unit test for Issue #3879

* mark test as failing
This commit is contained in:
Sofie Van Landeghem 2019-08-20 16:40:25 +02:00 committed by Ines Montani
parent 86cd7f0efd
commit 68ee0384fd

View File

@ -0,0 +1,21 @@
# coding: utf8
from __future__ import unicode_literals
import pytest
from spacy.lang.en import English
from spacy.matcher import Matcher
@pytest.mark.xfail
def test_issue3879(en_vocab):
nlp = English()
text = "This is a test."
doc = nlp(text)
assert len(doc) == 5
pattern = [{"ORTH": "This", "OP": "?"}, {"OP": "?"}, {"ORTH": "test"}]
matcher = Matcher(nlp.vocab)
matcher.add("rule", None, pattern)
matches = matcher(doc)
assert len(matches) == 2 # fails because of a FP match 'is a test'