diff options
author | mahesh | 2017-11-10 03:00:24 +0530 |
---|---|---|
committer | mahesh | 2017-11-10 03:00:24 +0530 |
commit | 8f3cd30a5fe553bc8aa701fc76ba8d2a55c4418f (patch) | |
tree | 79ba306e0dd23848e3f366d6b89a5f30aabea220 /yaksh/error_messages.py | |
parent | caf37373ec546d53db7caaf8aca9d5550d0ed4ad (diff) | |
download | online_test-8f3cd30a5fe553bc8aa701fc76ba8d2a55c4418f.tar.gz online_test-8f3cd30a5fe553bc8aa701fc76ba8d2a55c4418f.tar.bz2 online_test-8f3cd30a5fe553bc8aa701fc76ba8d2a55c4418f.zip |
No tracebacks if longer than 5 lines.
- Tracebacks with more than 5 lines will not be shown.
- Remove unnecessary imports.
- PEP8 change.
Diffstat (limited to 'yaksh/error_messages.py')
-rw-r--r-- | yaksh/error_messages.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/yaksh/error_messages.py b/yaksh/error_messages.py index 25b690b..77bb1c9 100644 --- a/yaksh/error_messages.py +++ b/yaksh/error_messages.py @@ -9,8 +9,8 @@ def prettify_exceptions(exception, message, traceback=None, testcase=None): "traceback": traceback, "message": message } - if exception == "RecursionError": - err["traceback"] = None + if traceback and traceback.count('\n') > 6: + err["traceback"] = None if exception == 'AssertionError': value = ("Expected answer from the" + " test case did not match the output") @@ -32,11 +32,11 @@ def _get_incorrect_user_lines(exp_lines, user_lines): def compare_outputs(expected_output, user_output, given_input=None): given_lines = user_output.splitlines() exp_lines = expected_output.splitlines() - msg = {"given_input":given_input, + msg = {"type": "stdio", + "given_input": given_input, "expected_output": exp_lines, - "user_output":given_lines, - "type": "stdio" - } + "user_output": given_lines + } ng = len(given_lines) ne = len(exp_lines) err_line_numbers = _get_incorrect_user_lines(exp_lines, given_lines) |