Skip to content

Commit

Permalink
Enhanced test for from_documents() method to cover ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
kai-car committed Aug 9, 2024
1 parent 83fffc1 commit 2eaf29c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/core/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,8 @@ def test_pie_dataset_from_documents(documents):

assert hasattr(dataset_from_documents, "document_type")

# Test dataset creation with empty list
empty_doc_list = list[Document]()
with pytest.raises(ValueError) as excinfo:
Dataset.from_documents(empty_doc_list)
assert str(excinfo.value) == "No documents to create dataset from"

0 comments on commit 2eaf29c

Please sign in to comment.