mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
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:
parent
b60d92aca8
commit
a3d4dd1a5d
|
@ -100,3 +100,10 @@ def test_disable_pipes_context(nlp, name):
|
||||||
with nlp.disable_pipes(name):
|
with nlp.disable_pipes(name):
|
||||||
assert not nlp.has_pipe(name)
|
assert not nlp.has_pipe(name)
|
||||||
assert 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user