Skip to content

Commit 6b99247

Browse files
committed
rm tests
1 parent 31219dc commit 6b99247

3 files changed

Lines changed: 10 additions & 29 deletions

File tree

integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ def _ensure_initialized(self):
114114
# Use dict to conditionally pass settings because Chroma doesn't accept settings=None
115115
client_kwargs: dict[str, Any] = {}
116116
if self._client_settings:
117-
client_kwargs["settings"] = Settings(**self._client_settings)
117+
try:
118+
client_kwargs["settings"] = Settings(**self._client_settings)
119+
except ValueError as e:
120+
msg = f"Invalid client_settings ({self._client_settings}): {e}"
121+
raise ValueError(msg) from e
118122

119123
if self._host and self._port is not None:
120124
# Remote connection via HTTP client
@@ -166,7 +170,11 @@ async def _ensure_initialized_async(self):
166170
# Use dict to conditionally pass settings because Chroma doesn't accept settings=None
167171
client_kwargs: dict[str, Any] = {}
168172
if self._client_settings:
169-
client_kwargs["settings"] = Settings(**self._client_settings)
173+
try:
174+
client_kwargs["settings"] = Settings(**self._client_settings)
175+
except ValueError as e:
176+
msg = f"Invalid client_settings ({self._client_settings}): {e}"
177+
raise ValueError(msg) from e
170178

171179
client = await chromadb.AsyncHttpClient(
172180
host=self._host,

integrations/chroma/tests/test_document_store.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,6 @@ def test_client_settings_applied(self, clear_chroma_system_cache):
124124
store._ensure_initialized()
125125
assert store._client.get_settings().anonymized_telemetry is False
126126

127-
def test_invalid_client_settings_are_ignored(self, clear_chroma_system_cache):
128-
store = ChromaDocumentStore(
129-
client_settings={
130-
"invalid_setting_name": "some_value",
131-
"another_fake_setting": 123,
132-
}
133-
)
134-
store._ensure_initialized()
135-
settings = store._client.get_settings()
136-
assert not hasattr(settings, "invalid_setting_name")
137-
assert not hasattr(settings, "another_fake_setting")
138-
139127
def test_to_dict(self, request):
140128
ds = ChromaDocumentStore(
141129
collection_name=request.node.name,

integrations/chroma/tests/test_document_store_async.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,6 @@ async def test_client_settings_applied_async(self):
107107
await store._ensure_initialized_async()
108108
assert store._async_client.get_settings().anonymized_telemetry is False
109109

110-
async def test_invalid_client_settings_are_ignored_async(self):
111-
store = ChromaDocumentStore(
112-
host="localhost",
113-
port=8000,
114-
client_settings={
115-
"invalid_setting_name": "some_value",
116-
"another_fake_setting": 123,
117-
},
118-
collection_name=f"{uuid.uuid1()}-async-invalid",
119-
)
120-
await store._ensure_initialized_async()
121-
settings = store._async_client.get_settings()
122-
assert not hasattr(settings, "invalid_setting_name")
123-
assert not hasattr(settings, "another_fake_setting")
124-
125110
async def test_search_async(self):
126111
document_store = ChromaDocumentStore(host="localhost", port=8000, collection_name="my_custom_collection")
127112

0 commit comments

Comments
 (0)