Skip to content

Commit 3c56a05

Browse files
committed
updating all tests to use new test class from haystack core
1 parent 4ef9058 commit 3c56a05

10 files changed

Lines changed: 20 additions & 19 deletions

File tree

integrations/astra/tests/test_document_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from haystack.document_stores.errors import MissingDocumentError
1212
from haystack.document_stores.types import DuplicatePolicy
1313
from haystack.testing.document_store import DocumentStoreBaseTests
14+
from haystack.testing.document_store import DocumentStoreBaseExtendedTests
1415

1516
from haystack_integrations.document_stores.astra import AstraDocumentStore
1617

@@ -48,7 +49,7 @@ def test_to_dict(mock_auth): # noqa
4849
os.environ.get("ASTRA_DB_APPLICATION_TOKEN", "") == "", reason="ASTRA_DB_APPLICATION_TOKEN env var not set"
4950
)
5051
@pytest.mark.skipif(os.environ.get("ASTRA_DB_API_ENDPOINT", "") == "", reason="ASTRA_DB_API_ENDPOINT env var not set")
51-
class TestDocumentStore(DocumentStoreBaseTests):
52+
class TestDocumentStore(DocumentStoreBaseTests, DocumentStoreBaseExtendedTests):
5253
"""
5354
Common test cases will be provided by `DocumentStoreBaseTests` but
5455
you can add more to this class.

integrations/azure_ai_search/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from haystack.testing.document_store import (
1515
CountDocumentsTest,
1616
DeleteDocumentsTest,
17+
DocumentStoreBaseExtendedTests,
1718
FilterDocumentsTest,
18-
UpdateByFilterTest,
1919
WriteDocumentsTest,
2020
)
2121
from haystack.utils.auth import EnvVarSecret, Secret
@@ -257,7 +257,7 @@ def _assert_documents_are_equal(received: list[Document], expected: list[Documen
257257
not os.environ.get("AZURE_AI_SEARCH_ENDPOINT", None) and not os.environ.get("AZURE_AI_SEARCH_API_KEY", None),
258258
reason="Missing AZURE_AI_SEARCH_ENDPOINT or AZURE_AI_SEARCH_API_KEY.",
259259
)
260-
class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, UpdateByFilterTest):
260+
class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, DocumentStoreBaseExtendedTests):
261261
def assert_documents_are_equal(self, received: list[Document], expected: list[Document]):
262262
_assert_documents_are_equal(received, expected)
263263

integrations/chroma/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
CountDocumentsTest,
1717
DeleteDocumentsTest,
1818
FilterDocumentsTest,
19-
UpdateByFilterTest,
19+
DocumentStoreBaseExtendedTests,
2020
)
2121

2222
from haystack_integrations.document_stores.chroma import ChromaDocumentStore
@@ -35,7 +35,7 @@ def clear_chroma_system_cache():
3535
SharedSystemClient.clear_system_cache()
3636

3737

38-
class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, FilterDocumentsTest, UpdateByFilterTest):
38+
class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, FilterDocumentsTest, DocumentStoreBaseExtendedTests):
3939
"""
4040
Common test cases will be provided by `DocumentStoreBaseTests` but
4141
you can add more to this class.

integrations/elasticsearch/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from haystack.dataclasses.document import Document
1111
from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError
1212
from haystack.document_stores.types import DuplicatePolicy
13-
from haystack.testing.document_store import DocumentStoreBaseTests
13+
from haystack.testing.document_store import DocumentStoreBaseTests, DocumentStoreBaseExtendedTests
1414
from haystack.utils import Secret
1515
from haystack.utils.auth import TokenSecret
1616

@@ -199,7 +199,7 @@ def test_client_initialization_with_api_key_string(_mock_async_es, _mock_es):
199199

200200

201201
@pytest.mark.integration
202-
class TestDocumentStore(DocumentStoreBaseTests):
202+
class TestDocumentStore(DocumentStoreBaseTests, DocumentStoreBaseExtendedTests):
203203
"""
204204
Common test cases will be provided by `DocumentStoreBaseTests` but
205205
you can add more to this class.

integrations/mongodb_atlas/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from haystack.dataclasses.document import ByteStream, Document
1111
from haystack.document_stores.errors import DuplicateDocumentError
1212
from haystack.document_stores.types import DuplicatePolicy
13-
from haystack.testing.document_store import DocumentStoreBaseTests
13+
from haystack.testing.document_store import DocumentStoreBaseTests, DocumentStoreBaseExtendedTests
1414
from haystack.utils import Secret
1515
from pymongo import MongoClient
1616
from pymongo.driver_info import DriverInfo
@@ -116,7 +116,7 @@ def test_document_conversion_methods_with_custom_field_names(self, _mock_client)
116116
reason="No MongoDB Atlas connection string provided",
117117
)
118118
@pytest.mark.integration
119-
class TestDocumentStore(DocumentStoreBaseTests):
119+
class TestDocumentStore(DocumentStoreBaseTests, DocumentStoreBaseExtendedTests):
120120
@pytest.fixture
121121
def document_store(self):
122122
database_name = "haystack_integration_test"

integrations/opensearch/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from haystack.testing.document_store import (
1313
CountDocumentsTest,
1414
DeleteDocumentsTest,
15-
UpdateByFilterTest,
15+
DocumentStoreBaseExtendedTests,
1616
WriteDocumentsTest,
1717
)
1818
from opensearchpy.exceptions import RequestError
@@ -156,7 +156,7 @@ def test_routing_in_delete(mock_bulk, document_store):
156156

157157

158158
@pytest.mark.integration
159-
class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, UpdateByFilterTest):
159+
class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, DocumentStoreBaseExtendedTests):
160160
"""
161161
Common test cases will be provided by `DocumentStoreBaseTests` but
162162
you can add more to this class.

integrations/pgvector/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from haystack.testing.document_store import (
1313
CountDocumentsTest,
1414
DeleteDocumentsTest,
15-
UpdateByFilterTest,
15+
DocumentStoreBaseExtendedTests,
1616
WriteDocumentsTest,
1717
)
1818
from haystack.utils import Secret
@@ -21,7 +21,7 @@
2121

2222

2323
@pytest.mark.integration
24-
class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, UpdateByFilterTest):
24+
class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, DocumentStoreBaseExtendedTests):
2525
def test_write_documents(self, document_store: PgvectorDocumentStore):
2626
docs = [Document(id="1")]
2727
assert document_store.write_documents(docs) == 1

integrations/pinecone/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from haystack.testing.document_store import (
1515
CountDocumentsTest,
1616
DeleteDocumentsTest,
17-
UpdateByFilterTest,
17+
DocumentStoreBaseExtendedTests,
1818
WriteDocumentsTest,
1919
)
2020
from haystack.utils import Secret
@@ -265,7 +265,7 @@ def test_serverless_index_creation_from_scratch(delete_sleep_time):
265265

266266
@pytest.mark.integration
267267
@pytest.mark.skipif(not os.environ.get("PINECONE_API_KEY"), reason="PINECONE_API_KEY not set")
268-
class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, WriteDocumentsTest, UpdateByFilterTest):
268+
class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, WriteDocumentsTest, DocumentStoreBaseExtendedTests):
269269
def test_write_documents(self, document_store: PineconeDocumentStore):
270270
docs = [Document(id="1")]
271271
assert document_store.write_documents(docs) == 1

integrations/qdrant/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from haystack.testing.document_store import (
99
CountDocumentsTest,
1010
DeleteDocumentsTest,
11-
UpdateByFilterTest,
11+
DocumentStoreBaseExtendedTests,
1212
WriteDocumentsTest,
1313
_random_embeddings,
1414
)
@@ -23,7 +23,7 @@
2323
)
2424

2525

26-
class TestQdrantDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, UpdateByFilterTest):
26+
class TestQdrantDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, DocumentStoreBaseExtendedTests):
2727
@pytest.fixture
2828
def document_store(self) -> QdrantDocumentStore:
2929
return QdrantDocumentStore(

integrations/weaviate/tests/test_document_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
CountDocumentsTest,
1717
DeleteDocumentsTest,
1818
FilterDocumentsTest,
19-
UpdateByFilterTest,
19+
DocumentStoreBaseExtendedTests,
2020
WriteDocumentsTest,
2121
create_filterable_docs,
2222
)
@@ -49,7 +49,7 @@ def test_init_is_lazy(_mock_client):
4949

5050
@pytest.mark.integration
5151
class TestWeaviateDocumentStore(
52-
CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, FilterDocumentsTest, UpdateByFilterTest
52+
CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest, FilterDocumentsTest, DocumentStoreBaseExtendedTests
5353
):
5454
@pytest.fixture
5555
def document_store(self, request) -> WeaviateDocumentStore:

0 commit comments

Comments
 (0)