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 Oct 1, 2024
1 parent ee68921 commit 8b1b520
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(reranker):
with pytest.raises(Exception):
reranker.rank("valid query", "not a list") # Invalid type for documents

with pytest.raises(Exception):
reranker.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 8b1b520

Please sign in to comment.