Skip to content

Commit

Permalink
Increased retry count for test_fileio_reader_pdf and updated assertio…
Browse files Browse the repository at this point in the history
…n to print better
  • Loading branch information
jamesbraza committed Sep 13, 2024
1 parent 93e7f60 commit 19835a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_paperqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,13 +837,15 @@ def test_pdf_reader_match_doc_details(stub_data_dir: Path) -> None:
assert "yes" in answer.answer or "Yes" in answer.answer


@pytest.mark.flaky(reruns=3, only_rerun=["AssertionError"])
@pytest.mark.flaky(reruns=5, only_rerun=["AssertionError"])
def test_fileio_reader_pdf(stub_data_dir: Path) -> None:
with (stub_data_dir / "paper.pdf").open("rb") as f:
docs = Docs()
docs.add_file(f, "Wellawatte et al, XAI Review, 2023")
answer = docs.query("Are counterfactuals actionable?[yes/no]")
assert "yes" in answer.answer or "Yes" in answer.answer
assert any(
w in answer.answer for w in ("yes", "Yes")
), f"Incorrect answer: {answer.answer}"


def test_fileio_reader_txt(stub_data_dir: Path) -> None:
Expand Down

0 comments on commit 19835a8

Please sign in to comment.