Generalizing tests for smarter LLMs 2#1154
Merged
jamesbraza merged 2 commits intomainfrom Oct 27, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses test failures caused by differences in LLM provider error messages and ambiguous test assertions. It follows up on a previous PR by fixing two remaining issues: Anthropic's different error message format for unsupported images, and confusion between the number "2" appearing in citation page ranges versus answer content.
Key Changes:
- Updated error message assertion to handle both OpenAI and Anthropic formats
- Changed test assertions from
session.answertosession.raw_answerto avoid confusion with citation metadata
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_paperqa.py | Modified unsupported image error check to accept multiple provider-specific error messages |
| packages/paper-qa-pypdf/tests/test_paperqa_pypdf.py | Clarified question text and switched from answer to raw_answer for more precise validation |
| packages/paper-qa-pymupdf/tests/test_paperqa_pymupdf.py | Clarified question text and switched from answer to raw_answer for more precise validation |
| packages/paper-qa-docling/tests/test_paperqa_docling.py | Clarified question text and switched from answer to raw_answer for more precise validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
abc7c9c to
5412ef2
Compare
8ac0db1 to
d96d09c
Compare
d96d09c to
fdcdb82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns out I missed a few in #1149:
raw_answerwith citations removed