Test adding of lots of pipeline components (see #1585)

Just to make sure that there's no error now or in the future with adding a large number of pipeline components.
This commit is contained in:
ines 2017-11-15 17:28:06 +01:00
parent b60d92aca8
commit a3d4dd1a5d

View File

@ -100,3 +100,10 @@ def test_disable_pipes_context(nlp, name):
with nlp.disable_pipes(name):
assert not nlp.has_pipe(name)
assert nlp.has_pipe(name)
@pytest.mark.parametrize('n_pipes', [100])
def test_add_lots_of_pipes(nlp, n_pipes):
for i in range(n_pipes):
nlp.add_pipe(lambda doc: doc, name='pipe_%d' % i)
assert len(nlp.pipe_names) == n_pipes