diff options
author | Prabhu Ramachandran | 2016-11-18 16:35:31 +0530 |
---|---|---|
committer | GitHub | 2016-11-18 16:35:31 +0530 |
commit | 7fab5de07a05cf8f84e7beb8b4c166c0398172be (patch) | |
tree | aa8950fbeff7c6fff463dbd9df33a891045ca303 /yaksh/python_assertion_evaluator.py | |
parent | d88708631a568c37ae56602407a29001d97a982f (diff) | |
parent | 2cb22a95912e6fe6bf97046de654207e4f265d8c (diff) | |
download | online_test-7fab5de07a05cf8f84e7beb8b4c166c0398172be.tar.gz online_test-7fab5de07a05cf8f84e7beb8b4c166c0398172be.tar.bz2 online_test-7fab5de07a05cf8f84e7beb8b4c166c0398172be.zip |
Merge pull request #160 from maheshgudi/add_datetimepicker
Date time picker and python assertion exception fix
Diffstat (limited to 'yaksh/python_assertion_evaluator.py')
-rw-r--r-- | yaksh/python_assertion_evaluator.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/yaksh/python_assertion_evaluator.py b/yaksh/python_assertion_evaluator.py index 275244a..986dbf2 100644 --- a/yaksh/python_assertion_evaluator.py +++ b/yaksh/python_assertion_evaluator.py @@ -69,9 +69,15 @@ 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 TimeoutException: + raise 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) |