From 139428c20f357f7d5b474c1b996e9a8a79f636ed Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Mon, 16 Sep 2019 15:16:54 +0200 Subject: [PATCH] Set unique vector names in tests --- spacy/tests/regression/test_issue1501-2000.py | 2 +- spacy/tests/regression/test_issue2501-3000.py | 2 +- spacy/tests/vocab_vectors/test_vectors.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/tests/regression/test_issue1501-2000.py b/spacy/tests/regression/test_issue1501-2000.py index 24f725ab8..520090bb4 100644 --- a/spacy/tests/regression/test_issue1501-2000.py +++ b/spacy/tests/regression/test_issue1501-2000.py @@ -187,7 +187,7 @@ def test_issue1799(): def test_issue1807(): """Test vocab.set_vector also adds the word to the vocab.""" - vocab = Vocab() + vocab = Vocab(vectors_name="test_issue1807") assert "hello" not in vocab vocab.set_vector("hello", numpy.ones((50,), dtype="f")) assert "hello" in vocab diff --git a/spacy/tests/regression/test_issue2501-3000.py b/spacy/tests/regression/test_issue2501-3000.py index cf29c2535..a0b1e2aac 100644 --- a/spacy/tests/regression/test_issue2501-3000.py +++ b/spacy/tests/regression/test_issue2501-3000.py @@ -184,7 +184,7 @@ def test_issue2833(en_vocab): def test_issue2871(): """Test that vectors recover the correct key for spaCy reserved words.""" words = ["dog", "cat", "SUFFIX"] - vocab = Vocab() + vocab = Vocab(vectors_name="test_issue2871") vocab.vectors.resize(shape=(3, 10)) vector_data = numpy.zeros((3, 10), dtype="f") for word in words: diff --git a/spacy/tests/vocab_vectors/test_vectors.py b/spacy/tests/vocab_vectors/test_vectors.py index 2a828de9c..4226bca3b 100644 --- a/spacy/tests/vocab_vectors/test_vectors.py +++ b/spacy/tests/vocab_vectors/test_vectors.py @@ -259,7 +259,7 @@ def test_vectors_doc_doc_similarity(vocab, text1, text2): def test_vocab_add_vector(): - vocab = Vocab() + vocab = Vocab(vectors_name="test_vocab_add_vector") data = numpy.ndarray((5, 3), dtype="f") data[0] = 1.0 data[1] = 2.0 @@ -272,7 +272,7 @@ def test_vocab_add_vector(): def test_vocab_prune_vectors(): - vocab = Vocab() + vocab = Vocab(vectors_name="test_vocab_prune_vectors") _ = vocab["cat"] # noqa: F841 _ = vocab["dog"] # noqa: F841 _ = vocab["kitten"] # noqa: F841