gradescope-utils
gradescope-utils copied to clipboard
Provide stack backtrace for errors in student code
When student code generates exceptions, e.g. IndexError, tests fail without any indication of the root cause, making it difficult for students to debug their code. This change to the JSON test runner provides context by outputting the last stack frame (easy to change for last N frames).
Thanks! This is a great idea, though I don't know if it should be the default behavior. It'd be preferable to make it configurable, either as a top-level setting on the JSONTestRunner object, or perhaps even a test-case-level setting via a decorator.