diff --git a/spacy/tests/test_util.py b/spacy/tests/test_util.py index 6b6e84a17..1410755db 100644 --- a/spacy/tests/test_util.py +++ b/spacy/tests/test_util.py @@ -1,7 +1,7 @@ import pytest from spacy.gold import Example -from .util import get_doc +from .util import get_random_doc from spacy.util import minibatch_by_words @@ -24,7 +24,7 @@ from spacy.util import minibatch_by_words ], ) def test_util_minibatch(doc_sizes, expected_batches): - docs = [get_doc(doc_size) for doc_size in doc_sizes] + docs = [get_random_doc(doc_size) for doc_size in doc_sizes] examples = [Example(doc=doc) for doc in docs] tol = 0.2 batch_size = 1000 @@ -49,7 +49,7 @@ def test_util_minibatch(doc_sizes, expected_batches): ) def test_util_minibatch_oversize(doc_sizes, expected_batches): """ Test that oversized documents are returned in their own batch""" - docs = [get_doc(doc_size) for doc_size in doc_sizes] + docs = [get_random_doc(doc_size) for doc_size in doc_sizes] examples = [Example(doc=doc) for doc in docs] tol = 0.2 batch_size = 1000 diff --git a/spacy/tests/util.py b/spacy/tests/util.py index 73650a6f7..3d0a023c9 100644 --- a/spacy/tests/util.py +++ b/spacy/tests/util.py @@ -92,7 +92,7 @@ def get_batch(batch_size): return docs -def get_doc(n_words): +def get_random_doc(n_words): vocab = Vocab() # Make the words numbers, so that they're easy to track. numbers = [str(i) for i in range(0, n_words)]