testwhat
testwhat copied to clipboard
check_body() should allow check_object() to look inside the function body
To test a function definition, it is sometime helpful to see if the student defined a particular variable.
At the moment, it seems that check_object()
always looks in the global environment.
Here's an example exercise showing the SCT I want to write and a hacky workaround.
https://www.datacamp.com/teach/repositories/986/branches/scope-of-check_object
In pythonwhat, this is possible as shown in the second example under check_object, but as a feature of the equality check instead of the object check.
There is an important difference: check_object
checks the final process state, while the equality check is done on a repeated evaluation.
Since not all needed functionality from pythonwhat is available in testwhat, you approach might be a good approach until it is.
Either way it is a good idea to add an example of the current best approach to the documentation.