Skip to content

Commit d435b6e

Browse files
committed
format
1 parent 08c9e48 commit d435b6e

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

tests/pytest/test_pytest_env_overwrite.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
from eval_protocol.pytest import evaluation_test
33
from eval_protocol.pytest.default_no_op_rollout_processor import NoOpRolloutProcessor
44
import 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

0 commit comments

Comments
 (0)