Skip to content

Commit 1a238a5

Browse files
test(chroma): override duplicate fail test for Chroma behaviour
1 parent b8fb275 commit 1a238a5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

integrations/chroma/tests/test_document_store_async.py

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

99
import pytest
1010
from haystack.dataclasses import Document
11+
from haystack.document_stores.types import DuplicatePolicy
1112
from haystack.testing.document_store import TEST_EMBEDDING_1
1213
from haystack.testing.document_store_async import (
1314
CountDocumentsAsyncTest,
@@ -83,6 +84,17 @@ async def test_write_documents_async(self, document_store: ChromaDocumentStore):
8384
await document_store.write_documents_async([doc])
8485
assert await document_store.count_documents_async() == 1
8586

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+
8698
# ── Chroma-specific tests (not covered by mixins) ──────────────────────
8799

88100
async def test_client_settings_applied_async(self):

0 commit comments

Comments
 (0)