From f168b5c22428f5a0a7f60ebd2b3322a0c3acf7d9 Mon Sep 17 00:00:00 2001 From: Tom Aarsen Date: Mon, 2 Dec 2024 12:45:40 +0100 Subject: [PATCH] Extend the no_eval_dataset_with_eval_strategy test with newly updated edge case --- tests/test_trainer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_trainer.py b/tests/test_trainer.py index a978d8f5e..2c0350d0c 100644 --- a/tests/test_trainer.py +++ b/tests/test_trainer.py @@ -645,7 +645,14 @@ def test_trainer_no_eval_dataset_with_eval_strategy( kwargs["evaluator"] = evaluator if not use_eval_dataset and not use_evaluator: - context = pytest.raises(ValueError, match=".*`args.eval_strategy`.*") + context = pytest.raises( + ValueError, + match=( + "You have set `args.eval_strategy` to IntervalStrategy.STEPS, but you didn't provide an " + "`eval_dataset` or an `evaluator`. Either provide an `eval_dataset` or an `evaluator` " + "to `SentenceTransformerTrainer`, or set `args.eval_strategy='no'` to skip evaluation." + ), + ) else: context = nullcontext()