diff --git a/tests/test_token_api.py b/tests/test_token_api.py index 6e35701b4..eb7e1013b 100644 --- a/tests/test_token_api.py +++ b/tests/test_token_api.py @@ -6,9 +6,9 @@ from spacy.en.attrs import IS_STOP import pytest +nlp = English() @pytest.fixture def token(): - nlp = English() tokens = nlp(u'Give it back! He pleaded.') return tokens[0] @@ -29,3 +29,11 @@ def test_flags(token): assert token.check_flag(IS_ALPHA) assert not token.check_flag(IS_DIGIT) # TODO: Test more of these, esp. if a bug is found + + +def test_single_token_string(): + nlp = English() + tokens = nlp(u'foobar') + assert tokens[0].string == 'foobar' + +