Skip to content

Commit b3b0020

Browse files
authored
fix: remove document mutation from weaviate tests(#3160)
1 parent fd24f00 commit b3b0020

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

integrations/weaviate/tests/test_document_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import os
88
from collections.abc import Generator
9+
from dataclasses import replace
910
from unittest.mock import MagicMock, patch
1011

1112
import pytest
@@ -373,7 +374,7 @@ def test_write_documents(self, document_store):
373374
assert document_store.write_documents([doc]) == 1
374375
assert document_store.count_documents() == 1
375376

376-
doc.content = "test doc 2"
377+
doc = replace(doc, content="test doc 2")
377378
assert document_store.write_documents([doc]) == 1
378379
assert document_store.count_documents() == 1
379380

integrations/weaviate/tests/test_document_store_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66
from collections.abc import AsyncGenerator
7+
from dataclasses import replace
78
from pathlib import Path
89

910
import pytest
@@ -100,7 +101,7 @@ async def test_write_documents_async(self, document_store: WeaviateDocumentStore
100101
assert await document_store.write_documents_async([doc]) == 1
101102
assert await document_store.count_documents_async() == 1
102103

103-
doc.content = "test doc 2"
104+
doc = replace(doc, content="test doc 2")
104105
assert await document_store.write_documents_async([doc]) == 1
105106
assert await document_store.count_documents_async() == 1
106107

0 commit comments

Comments
 (0)