Skip to content

Commit

Permalink
test(docstore): enhance test_add_documents with dynamic `docstore_c…
Browse files Browse the repository at this point in the history
…lass` parameter

- Introduce `docstore_class` parameter to `test_add_documents` function to increase test flexibility and facilitate testing with different document store implementations.
- Replace direct call to `delete_collection` with `docstore.reset()` for cleanup, aligning with best practices for test isolation and teardown.
  • Loading branch information
ericmjl committed Mar 18, 2024
1 parent 189f7c7 commit 7604d8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/components/test_docstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_document_store():
docstore.client.delete_collection("test_collection")


def test_add_documents(tmp_path: Path):
def test_add_documents(tmp_path: Path, docstore_class):
"""Test the add_documents method of DocumentStore."""
# Create a temporary collection for testing
collection_name = "test_collection"
Expand Down Expand Up @@ -51,4 +51,4 @@ def test_add_documents(tmp_path: Path):
)

# Clean up the temporary collection
docstore.client.delete_collection(collection_name)
docstore.reset()

0 comments on commit 7604d8d

Please sign in to comment.