Skip to content

Commit c2ac6f6

Browse files
test(chroma): remove WriteDocumentsAsyncTest mixin - Chroma has custom write behaviour
1 parent 1a238a5 commit c2ac6f6

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

integrations/chroma/tests/test_document_store_async.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import pytest
1010
from haystack.dataclasses import Document
11-
from haystack.document_stores.types import DuplicatePolicy
1211
from haystack.testing.document_store import TEST_EMBEDDING_1
1312
from haystack.testing.document_store_async import (
1413
CountDocumentsAsyncTest,
@@ -22,7 +21,6 @@
2221
GetMetadataFieldsInfoAsyncTest,
2322
GetMetadataFieldUniqueValuesAsyncTest,
2423
UpdateByFilterAsyncTest,
25-
WriteDocumentsAsyncTest,
2624
)
2725

2826
from haystack_integrations.document_stores.chroma import ChromaDocumentStore
@@ -63,7 +61,6 @@ class TestDocumentStoreAsync(
6361
GetMetadataFieldsInfoAsyncTest,
6462
GetMetadataFieldUniqueValuesAsyncTest,
6563
UpdateByFilterAsyncTest,
66-
WriteDocumentsAsyncTest,
6764
):
6865
@pytest.fixture
6966
def document_store(self, embedding_function) -> ChromaDocumentStore:
@@ -78,23 +75,14 @@ def document_store(self, embedding_function) -> ChromaDocumentStore:
7875
port=8000,
7976
)
8077

78+
# ── Chroma-specific write test ──────────────────────────────────────────
79+
8180
async def test_write_documents_async(self, document_store: ChromaDocumentStore):
82-
"""Override: Chroma uses DuplicatesPolicy.OVERWRITE by default."""
81+
"""Chroma-specific: basic write test."""
8382
doc = Document(content="test doc")
8483
await document_store.write_documents_async([doc])
8584
assert await document_store.count_documents_async() == 1
8685

87-
async def test_write_documents_duplicate_fail_async(self, document_store: ChromaDocumentStore):
88-
"""Override: Chroma does not raise DuplicateDocumentError.
89-
90-
Chroma silently overwrites duplicate documents regardless of policy.
91-
"""
92-
93-
doc = Document(content="test doc")
94-
await document_store.write_documents_async([doc], policy=DuplicatePolicy.FAIL)
95-
# Chroma silently overwrites — verify doc still exists
96-
assert await document_store.count_documents_async() == 1
97-
9886
# ── Chroma-specific tests (not covered by mixins) ──────────────────────
9987

10088
async def test_client_settings_applied_async(self):

0 commit comments

Comments
 (0)