diff options
author | ankitjavalkar | 2017-02-13 15:21:34 +0530 |
---|---|---|
committer | ankitjavalkar | 2017-02-16 18:09:37 +0530 |
commit | 85412e8f77a268590cf8ca6f6cd6facd8fdc3c2c (patch) | |
tree | b552d367d054c7d13f928235a8ae7bdd8c8b8355 /yaksh/evaluator_tests | |
parent | 8eea8e99258f073374912985acc191295536deeb (diff) | |
download | online_test-85412e8f77a268590cf8ca6f6cd6facd8fdc3c2c.tar.gz online_test-85412e8f77a268590cf8ca6f6cd6facd8fdc3c2c.tar.bz2 online_test-85412e8f77a268590cf8ca6f6cd6facd8fdc3c2c.zip |
Merge all error handling into single code block and fix relevant test cases for Python assertion
Diffstat (limited to 'yaksh/evaluator_tests')
-rw-r--r-- | yaksh/evaluator_tests/test_python_evaluation.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py index 6346941..b908ff7 100644 --- a/yaksh/evaluator_tests/test_python_evaluation.py +++ b/yaksh/evaluator_tests/test_python_evaluation.py @@ -235,7 +235,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): # Then self.assertFalse(result.get("success")) - self.assertEqual(6, len(err)) + self.assertEqual(22, len(err)) for msg in name_error_msg: self.assert_correct_output(msg, result.get("error")) @@ -245,8 +245,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): def add(a, b): return add(3, 3) """) - recursion_error_msg = ["Traceback", - "call", + recursion_error_msg = ["Traceback", "maximum recursion depth exceeded" ] @@ -301,7 +300,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): # Then self.assertFalse(result.get("success")) - self.assertEqual(6, len(err)) + self.assertEqual(22, len(err)) for msg in type_error_msg: self.assert_correct_output(msg, result.get("error")) @@ -337,7 +336,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): # Then self.assertFalse(result.get("success")) - self.assertEqual(6, len(err)) + self.assertEqual(25, len(err)) for msg in value_error_msg: self.assert_correct_output(msg, result.get("error")) @@ -404,7 +403,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): # Then self.assertFalse(result.get("success")) - self.assertEqual(5, len(err)) + self.assertEqual(12, len(err)) for msg in syntax_error_msg: self.assert_correct_output(msg, result.get("error")) @@ -446,7 +445,7 @@ class PythonAssertionEvaluationTestCases(EvaluatorBaseTest): # Then self.assertFalse(result.get("success")) - self.assertEqual(2, len(err)) + self.assertEqual(10, len(err)) for msg in name_error_msg: self.assert_correct_output(msg, result.get("error")) |