summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaheshgudi2016-11-18 15:52:20 +0530
committermaheshgudi2016-11-18 15:52:20 +0530
commit8db94931bfd2fd0bab9e3b1bf0fc6d4aeb7b9274 (patch)
treed7f97d7bb53ca22d4f8a065b10868e8655f7f796
parentfeee73459c681a104d590dd299dc91585650f49e (diff)
downloadonline_test-8db94931bfd2fd0bab9e3b1bf0fc6d4aeb7b9274.tar.gz
online_test-8db94931bfd2fd0bab9e3b1bf0fc6d4aeb7b9274.tar.bz2
online_test-8db94931bfd2fd0bab9e3b1bf0fc6d4aeb7b9274.zip
changed execption messages in python_assertion_evaluator.
-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)