mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-08-29 19:06:21 +00:00
test: Check only top answer in extractive QA e2e test (#6614)
This commit is contained in:
parent
8469c7f702
commit
d90f95be2e
@ -61,6 +61,10 @@ def test_extractive_qa_pipeline(tmp_path):
|
||||
assert hasattr(answer, "document_offset")
|
||||
|
||||
assert hasattr(answer, "document")
|
||||
# the answer is extracted from the correct document
|
||||
if answer.document is not None:
|
||||
assert answer.document.id == doc.id
|
||||
|
||||
# the top answer is extracted from the correct document
|
||||
top_answer = extracted_answers[0]
|
||||
if top_answer.document is not None:
|
||||
if top_answer.document.id != doc.id:
|
||||
print(top_answer.document.id, doc.id)
|
||||
assert top_answer.document.id == doc.id
|
||||
|
Loading…
x
Reference in New Issue
Block a user