Skip to content

Commit 59cc988

Browse files
committed
parsing on test
1 parent 49c7c11 commit 59cc988

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎tests/test_parsing.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ def test_final_var_answer(self):
9090
text = "Check the variable:\nFINAL_VAR(result)"
9191
# Create a mock environment that returns the variable value
9292
mock_env = Mock()
93-
mock_env.execute_code.return_value = REPLResult(
94-
stdout="42", stderr="", locals={}
95-
)
93+
mock_env.execute_code.return_value = REPLResult(stdout="42", stderr="", locals={})
9694
result = find_final_answer(text, environment=mock_env)
9795
assert result == "42"
9896
# Verify execute_code was called with the correct code
@@ -199,9 +197,7 @@ def test_final_and_final_var_parsing(self):
199197
def test_final_var_takes_precedence_over_final(self):
200198
"""Test that FINAL_VAR is checked first and takes precedence over FINAL."""
201199
mock_env = Mock()
202-
mock_env.execute_code.return_value = REPLResult(
203-
stdout="var_value", stderr="", locals={}
204-
)
200+
mock_env.execute_code.return_value = REPLResult(stdout="var_value", stderr="", locals={})
205201

206202
# If both appear, FINAL_VAR should be found first (checked first in the function)
207203
text = "FINAL_VAR(result)\nFINAL(direct_answer)"
@@ -244,9 +240,7 @@ def test_final_var_retrieves_actual_variables_from_environment(self):
244240
# Test retrieving list variable
245241
text = "FINAL_VAR(answer)"
246242
result = find_final_answer(text, environment=env)
247-
assert (
248-
result == "[1, 2, 3, 4, 5]"
249-
), f"Expected '[1, 2, 3, 4, 5]', got '{result}'"
243+
assert result == "[1, 2, 3, 4, 5]", f"Expected '[1, 2, 3, 4, 5]', got '{result}'"
250244

251245
# Test retrieving computed variable
252246
text = "FINAL_VAR(computed)"

0 commit comments

Comments
 (0)