From 8db94931bfd2fd0bab9e3b1bf0fc6d4aeb7b9274 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Fri, 18 Nov 2016 15:52:20 +0530 Subject: changed execption messages in python_assertion_evaluator. --- yaksh/python_assertion_evaluator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'yaksh/python_assertion_evaluator.py') diff --git a/yaksh/python_assertion_evaluator.py b/yaksh/python_assertion_evaluator.py index 275244a..ba1890f 100644 --- a/yaksh/python_assertion_evaluator.py +++ b/yaksh/python_assertion_evaluator.py @@ -69,9 +69,13 @@ class PythonAssertionEvaluator(CodeEvaluator): fname, lineno, func, text = info[-1] text = str(test_case).splitlines()[lineno-1] err = ("-----\nExpected Test Case:\n{0}\n" - "Error - {1} {2} in: {3}\n-----").format(test_case, type.__name__, str(value), text) + "Error - {1} {2} in: {3}\n-----").format(test_case, + type.__name__, + str(value), text + ) except Exception: - raise # Exception will be caught in CodeEvaluator. + msg = traceback.format_exc(limit=0) + err = "Error in Test case: {0}".format(msg) else: success = True err = '-----\nCorrect answer\nTest Case: {0}\n-----'.format(test_case) -- cgit