Skip to content

Commit

Permalink
make test sync
Browse files Browse the repository at this point in the history
  • Loading branch information
tcapelle committed Jan 13, 2025
1 parent 77c6166 commit 725ead0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/scorers/test_coherence_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ def test_score_messages(coherence_scorer):


@pytest.mark.asyncio
async def test_score_with_chat_history(coherence_scorer):
def test_score_with_chat_history(coherence_scorer):
"""Test the async .score method with chat history."""
prompt = "This is a test prompt."
output = "This is a coherent response."
chat_history = [
{"role": "user", "text": "Hello"},
{"role": "assistant", "text": "Hi"},
]
result = await coherence_scorer.score(prompt, output, chat_history=chat_history)
result = coherence_scorer.score(prompt, output, chat_history=chat_history)
assert result["flagged"]
assert result["extras"]["coherence_label"] == "A Little Incoherent"


@pytest.mark.asyncio
async def test_score_with_context(coherence_scorer):
def test_score_with_context(coherence_scorer):
"""Test the async .score method with additional context."""
prompt = "This is a test prompt."
output = "This is a coherent response."
context = "This is additional context."
result = await coherence_scorer.score(prompt, output, context=context)
result = coherence_scorer.score(prompt, output, context=context)
assert result["flagged"]
assert result["extras"]["coherence_label"] == "A Little Incoherent"

0 comments on commit 725ead0

Please sign in to comment.