Skip to content

Commit

Permalink
check reranker type first before test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerhutcherson committed Jan 13, 2025
1 parent 1cbe7a6 commit 516fd33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/integration/test_rerankers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ def test_bad_input_cohere(cohereReranker):
with pytest.raises(Exception):
cohereReranker.rank("valid query", "not a list") # Invalid type for documents

with pytest.raises(Exception):
cohereReranker.rank(
"valid query", [{"field": "valid document"}], rank_by=["invalid_field"]
) # Invalid rank_by field
if isinstance(reranker, CohereReranker):
with pytest.raises(Exception):
reranker.rank(
"valid query", [{"field": "valid document"}], rank_by=["invalid_field"]
) # Invalid rank_by field


def test_rank_documents_cross_encoder(hfCrossEncoderReranker):
Expand Down

0 comments on commit 516fd33

Please sign in to comment.