diff --git a/spacy/tests/parser/test_sbd.py b/spacy/tests/parser/test_sbd.py index 332147177..8ba54060b 100644 --- a/spacy/tests/parser/test_sbd.py +++ b/spacy/tests/parser/test_sbd.py @@ -100,15 +100,6 @@ def test_sbd_serialization_projective(EN): assert [s.text for s in example.sents] == [s.text for s in example_serialized.sents] -def test_sbd_empty_string(EN): - '''Test Issue #309: SBD fails on empty string - ''' - doc = EN(u' ') - doc.is_parsed = True - assert len(doc) == 1 - sents = list(doc.sents) - assert len(sents) == 1 - # TODO: # @pytest.mark.models diff --git a/spacy/tests/regression/test_issue309.py b/spacy/tests/regression/test_issue309.py new file mode 100644 index 000000000..4d69482a0 --- /dev/null +++ b/spacy/tests/regression/test_issue309.py @@ -0,0 +1,14 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from ..util import get_doc + + +def test_sbd_empty_string(en_tokenizer): + """Test Issue #309: SBD fails on empty string""" + tokens = en_tokenizer(" ") + doc = get_doc(tokens.vocab, [t.text for t in tokens], heads=[0], deps=['ROOT']) + doc.is_parsed = True + assert len(doc) == 1 + sents = list(doc.sents) + assert len(sents) == 1