summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/python_assertion_evaluator.py8
1 files changed, 6 insertions, 2 deletions
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)