diff options
author | adityacp | 2018-04-06 15:01:01 +0530 |
---|---|---|
committer | adityacp | 2018-04-06 15:01:01 +0530 |
commit | 463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162 (patch) | |
tree | f588d67b8e0390099f79d3d696bce80e8c2536a2 /yaksh/python_assertion_evaluator.py | |
parent | 680b741cb066bae3e074c9feade61bf7792ef384 (diff) | |
download | online_test-463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162.tar.gz online_test-463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162.tar.bz2 online_test-463cd907d0e744d5bbbd5ed5f0d0dde1bd8ca162.zip |
Add error line number in error output
Diffstat (limited to 'yaksh/python_assertion_evaluator.py')
-rw-r--r-- | yaksh/python_assertion_evaluator.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/yaksh/python_assertion_evaluator.py b/yaksh/python_assertion_evaluator.py index 8c7d451..1f2b82b 100644 --- a/yaksh/python_assertion_evaluator.py +++ b/yaksh/python_assertion_evaluator.py @@ -74,12 +74,14 @@ class PythonAssertionEvaluator(BaseEvaluator): except Exception: exc_type, exc_value, exc_tb = sys.exc_info() tb_list = traceback.format_exception(exc_type, exc_value, exc_tb) + line_no = traceback.extract_tb(exc_tb)[-1][1] if len(tb_list) > 2: del tb_list[1:3] err = prettify_exceptions(exc_type.__name__, str(exc_value), "".join(tb_list), - self.test_case + self.test_case, + line_no ) else: success = True |