Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_body() should allow check_object() to look inside the function body #210

Open
richierocks opened this issue Oct 12, 2018 · 1 comment

Comments

@richierocks
Copy link
Contributor

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

@hermansje
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants