Add regression test for #636

This commit is contained in:
ines 2017-03-13 12:08:31 +01:00
parent 337f9601f2
commit c8ae682ff9
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
# coding: utf8
from __future__ import unicode_literals
from ...tokens.doc import Doc
import pytest
@pytest.mark.xfail
@pytest.mark.models
@pytest.mark.parametrize('text', ["I cant do this."])
def test_issue636(EN, text):
"""Test that to_bytes and from_bytes don't change the token lemma."""
doc1 = EN(text)
doc2 = Doc(EN.vocab)
doc2.from_bytes(doc1.to_bytes())
print([t.lemma_ for t in doc1], [t.lemma_ for t in doc2])
assert [t.lemma_ for t in doc1] == [t.lemma_ for t in doc2]