
Among the code from Ragchain
def test_ko_strategy_qa_evaluator(strategy_qa_evaluator):
with pytest.raises(ValueError):
strategy_qa_evaluator.evaluate(validate_passages=True)
result = strategy_qa_evaluator.evaluate(validate_passages=False)
assert len(result.each_results) == 5
assert result.each_results.iloc[0][
'question'] == 'Are more people today related to Genghis Khan than Julius Caesar?'
If an exception occurs below with, it raises the error specified by the parameter inside pytest.raises().
Using the code above as an example, if validate_passages in strategy_qa_evaluator.evaluate(validate_passages=True) is False rather than True, it raises the ValueError specified in pytest.raises(ValueError).