From 682466ec7eca0f1b1bb139225c760dbb8775f2ca Mon Sep 17 00:00:00 2001 From: tligui_y Date: Thu, 31 Jul 2025 14:59:28 +0200 Subject: [PATCH] Update tests/test_utils_eval.py --- tests/test_utils_eval.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_utils_eval.py b/tests/test_utils_eval.py index df650f24e..a452c16f4 100644 --- a/tests/test_utils_eval.py +++ b/tests/test_utils_eval.py @@ -23,7 +23,7 @@ from slic.utils.eval import * ("3 + +4", 7), ("3 + -4", -1), ("True + 1", 2), - ("string", "string"), + ('string', 'string'), ("1e1000 * 1e1000", float("inf")), ("'a' + 'b'", "ab") # string concatenation supported !!! ]) @@ -36,13 +36,14 @@ def test_arithmetic_eval_valid(expr, expected): # test ArithmeticEvalError of get_operator ("2 ** 3", "Unsupported BinOp Pow"), ("3 << 1", "Unsupported BinOp LShift"), - ("1 < 2", "Unsupported BinOp Lt"), - ("abs(3)", "Unsupported Call"), - ("a + 2", "Unsupported Name"), # test ArithmeticEvalError of arithmetic_eval - ("[1, 2] + [3]", "Unsupported node type: list"), - ("{1: 2}", "Unsupported node type: dict"), + ("1 < 2", "Unsupported node type Compare"), + ("abs(3)", "Unsupported node type Call"), + ("a + 2", "Unsupported node type Name"), + ("string", "Unsupported node type Name"), + ("[1, 2] + [3]", "Unsupported node type List"), + ("{1: 2}", "Unsupported node type Dict"), ]) def test_arithmetic_eval_raises_with_message(expr, expected_message): with pytest.raises(ArithmeticEvalError, match=expected_message):