When the student code fails parsing, and the associated exception has a line number, then testing does not occur.
This is on the basis that ast might fail to analyse the code successfully if there is such a fundamental compilation error.
It is implemented in _run_tests, in tests.py; the code raises a StudentCodeError.
One side-effect of this exception being raised is that there is no test data available.
This means that the listbox isn't filled out.
Not only might this be confusing, it means that if you click on the listbox you'll get an error.
Possible solutions:
skip the analysis, but run the full test suite anyway, thus giving us something to display (albeit that each test will be an error)
skip both analysis and testing, but insert a dummy TutorialTester instance, with a single failed test, the test being something like 'code compiles'
When the student code fails parsing, and the associated exception has a line number, then testing does not occur.
This is on the basis that
ast
might fail to analyse the code successfully if there is such a fundamental compilation error.It is implemented in
_run_tests
, intests.py
; the code raises aStudentCodeError
.One side-effect of this exception being raised is that there is no test data available. This means that the listbox isn't filled out. Not only might this be confusing, it means that if you click on the listbox you'll get an error.
Possible solutions:
TutorialTester
instance, with a single failed test, the test being something like 'code compiles'