Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing two more tests #340

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/test_paperqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,10 @@ def test_pdf_reader_match_doc_details(stub_data_dir: Path):
fields=["author", "journal"],
)
doc_details = next(iter(docs.docs.values()))
assert doc_details.dockey == "5300ef1d5fb960d7"
assert doc_details.dockey in {
"41f786fcc56d27ff0c1507153fae3774", # From file contents
"5300ef1d5fb960d7", # Or from crossref data
}
# note year is unknown because citation string is only parsed for authors/title/doi
# AND we do not request it back from the metadata sources
assert doc_details.docname == "wellawatteUnknownyearaperspectiveon"
Expand All @@ -914,7 +917,8 @@ def test_pdf_reader_match_doc_details(stub_data_dir: Path):
assert "yes" in answer.answer or "Yes" in answer.answer


def test_fileio_reader_pdf(stub_data_dir: Path):
@pytest.mark.flaky(reruns=3, 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")
Expand Down
Loading