mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Tidy up and expect warning
This commit is contained in:
parent
732142bf28
commit
7c69d30de5
|
@ -1,11 +1,12 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import pytest
|
||||||
from spacy.kb import KnowledgeBase
|
from spacy.kb import KnowledgeBase
|
||||||
from spacy.util import ensure_path
|
from spacy.util import ensure_path
|
||||||
|
|
||||||
from spacy.lang.en import English
|
from spacy.lang.en import English
|
||||||
from spacy.tests.util import make_tempdir
|
|
||||||
|
from ..tests.util import make_tempdir
|
||||||
|
|
||||||
|
|
||||||
def test_issue4674():
|
def test_issue4674():
|
||||||
|
@ -15,9 +16,12 @@ def test_issue4674():
|
||||||
|
|
||||||
vector1 = [0.9, 1.1, 1.01]
|
vector1 = [0.9, 1.1, 1.01]
|
||||||
vector2 = [1.8, 2.25, 2.01]
|
vector2 = [1.8, 2.25, 2.01]
|
||||||
kb.set_entities(
|
with pytest.warns(UserWarning):
|
||||||
entity_list=["Q1", "Q1"], freq_list=[32, 111], vector_list=[vector1, vector2]
|
kb.set_entities(
|
||||||
)
|
entity_list=["Q1", "Q1"],
|
||||||
|
freq_list=[32, 111],
|
||||||
|
vector_list=[vector1, vector2],
|
||||||
|
)
|
||||||
|
|
||||||
assert kb.get_size_entities() == 1
|
assert kb.get_size_entities() == 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user