pythonwhat icon indicating copy to clipboard operation
pythonwhat copied to clipboard

check_function: way to test if arguments are NOT specified

Open filipsch opened this issue 6 years ago • 0 comments

With check_function() and check_args(), it is possible whether some arguments are specified, and whether they are correct (with has_equal_ast()), but it is not possible to check if some arguments are not specified. There is test_not() functionality, but this will not work in the current implementation: if certain arguments are not found in the solution, an exception is thrown and the SCT execution errors out.

To improve this, we could adopt a TestFailSolution exception, that is thrown every time we're trying to access e.g. an argument that is also not in the solution. This error is actually thrown if we're not in test_not() mode (the SCT was incorrectly written), and that is swallowed if we are in test_not() mode (the SCT did this on purpose).

cc @yashasroy

filipsch avatar Jun 08 '18 07:06 filipsch