File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 22from eval_protocol .pytest import evaluation_test
33from eval_protocol .pytest .default_no_op_rollout_processor import NoOpRolloutProcessor
44import os
5+ from unittest import mock
56
6- os .environ ["EP_INVOCATION_ID" ] = "test-invocation-123"
77
8+ with mock .patch .dict (os .environ , {"EP_INVOCATION_ID" : "test-invocation-123" }):
89
9- @evaluation_test (
10- input_rows = [[EvaluationRow (messages = [Message (role = "user" , content = "What is the capital of France?" )])]],
11- completion_params = [{"model" : "no-op" }],
12- rollout_processor = NoOpRolloutProcessor (),
13- mode = "pointwise" ,
14- )
15- def test_input_messages_in_decorator (row : EvaluationRow ) -> EvaluationRow :
16- """Run math evaluation on sample dataset using pytest interface."""
17- assert row .messages [0 ].content == "What is the capital of France?"
18- assert row .execution_metadata .invocation_id == "test-invocation-123"
19- return row
10+ @evaluation_test (
11+ input_rows = [[EvaluationRow (messages = [Message (role = "user" , content = "What is the capital of France?" )])]],
12+ completion_params = [{"model" : "no-op" }],
13+ rollout_processor = NoOpRolloutProcessor (),
14+ mode = "pointwise" ,
15+ )
16+ def test_input_messages_in_decorator (row : EvaluationRow ) -> EvaluationRow :
17+ """Run math evaluation on sample dataset using pytest interface."""
18+ assert row .messages [0 ].content == "What is the capital of France?"
19+ assert row .execution_metadata .invocation_id == "test-invocation-123"
20+ return row
You can’t perform that action at this time.
0 commit comments