2017-04-07 16:09:23 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2017-04-07 13:47:27 +00:00
|
|
|
import pytest
|
|
|
|
from ... import load as load_spacy
|
|
|
|
|
|
|
|
|
2017-04-07 16:09:23 +00:00
|
|
|
def test_issue957(en_tokenizer):
|
2017-04-07 13:47:27 +00:00
|
|
|
'''Test that spaCy doesn't hang on many periods.'''
|
|
|
|
string = '0'
|
|
|
|
for i in range(1, 100):
|
|
|
|
string += '.%d' % i
|
|
|
|
doc = en_tokenizer(string)
|
|
|
|
|
|
|
|
# Don't want tests to fail if they haven't installed pytest-timeout plugin
|
|
|
|
try:
|
|
|
|
test_issue913 = pytest.mark.timeout(5)(test_issue913)
|
|
|
|
except NameError:
|
|
|
|
pass
|