feat: include testing facilities into haystack package (#4182)

This commit is contained in:
Massimiliano Pippi 2023-02-17 19:38:03 +01:00 committed by GitHub
parent 44509cd6a1
commit 83d615a32b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 10 additions and 23 deletions

View File

@ -0,0 +1 @@
from .document_store import DocumentStoreBaseTestAbstract

View File

@ -1,3 +1,4 @@
# pylint: disable=too-many-public-methods
import sys import sys
import pytest import pytest

View File

@ -9,8 +9,8 @@ from haystack.document_stores.elasticsearch import ElasticsearchDocumentStore, E
from haystack.document_stores.es_converter import elasticsearch_index_to_document_store from haystack.document_stores.es_converter import elasticsearch_index_to_document_store
from haystack.document_stores.memory import InMemoryDocumentStore from haystack.document_stores.memory import InMemoryDocumentStore
from haystack.nodes import PreProcessor from haystack.nodes import PreProcessor
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
from .test_search_engine import SearchEngineDocumentStoreTestAbstract from .test_search_engine import SearchEngineDocumentStoreTestAbstract

View File

@ -1,18 +1,11 @@
import sys
import os
import yaml
import faiss import faiss
import pytest import pytest
import numpy as np import numpy as np
from haystack.schema import Document
from haystack.document_stores.faiss import FAISSDocumentStore from haystack.document_stores.faiss import FAISSDocumentStore
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
from haystack.pipelines import Pipeline from haystack.pipelines import Pipeline
from haystack.nodes.retriever.dense import EmbeddingRetriever
from ..conftest import MockDenseRetriever from ..conftest import MockDenseRetriever

View File

@ -7,8 +7,7 @@ import numpy as np
from haystack.document_stores.memory import InMemoryDocumentStore from haystack.document_stores.memory import InMemoryDocumentStore
from haystack.schema import Document from haystack.schema import Document
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
class TestInMemoryDocumentStore(DocumentStoreBaseTestAbstract): class TestInMemoryDocumentStore(DocumentStoreBaseTestAbstract):

View File

@ -3,8 +3,7 @@ import numpy as np
from haystack.document_stores.milvus import MilvusDocumentStore from haystack.document_stores.milvus import MilvusDocumentStore
from haystack.schema import Document from haystack.schema import Document
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
class TestMilvusDocumentStore(DocumentStoreBaseTestAbstract): class TestMilvusDocumentStore(DocumentStoreBaseTestAbstract):

View File

@ -18,8 +18,8 @@ from haystack.document_stores.opensearch import (
tqdm, tqdm,
) )
from haystack.errors import DocumentStoreError from haystack.errors import DocumentStoreError
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
from .test_search_engine import SearchEngineDocumentStoreTestAbstract from .test_search_engine import SearchEngineDocumentStoreTestAbstract

View File

@ -10,9 +10,8 @@ import pytest
from haystack.document_stores.pinecone import PineconeDocumentStore from haystack.document_stores.pinecone import PineconeDocumentStore
from haystack.schema import Document from haystack.schema import Document
from haystack.errors import FilterError, PineconeDocumentStoreError from haystack.errors import FilterError, PineconeDocumentStoreError
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
from ..mocks import pinecone as pinecone_mock from ..mocks import pinecone as pinecone_mock
from ..nodes.test_retriever import MockBaseRetriever from ..nodes.test_retriever import MockBaseRetriever

View File

@ -5,8 +5,7 @@ import pytest
from haystack.document_stores.sql import LabelORM, SQLDocumentStore from haystack.document_stores.sql import LabelORM, SQLDocumentStore
from haystack.schema import Document from haystack.schema import Document
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
class TestSQLDocumentStore(DocumentStoreBaseTestAbstract): class TestSQLDocumentStore(DocumentStoreBaseTestAbstract):

View File

@ -1,5 +1,3 @@
import math
import pytest import pytest
import numpy as np import numpy as np

View File

@ -2,9 +2,7 @@ import pytest
from haystack.document_stores.weaviate import WeaviateDocumentStore from haystack.document_stores.weaviate import WeaviateDocumentStore
from haystack.schema import Document from haystack.schema import Document
from haystack.testing import DocumentStoreBaseTestAbstract
from .test_base import DocumentStoreBaseTestAbstract
import uuid import uuid
from unittest.mock import MagicMock from unittest.mock import MagicMock