You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usually only corresponds to a single node, it is None
usually corresponds to one or more nodes, it is an empty list
However, the orelse node lives a double life. Sometimes it is a list of expressions, as in...
ifTrue: passelse:
"a""b"
Sometimes it is a list containing only another If node, as in...
ifTrue: 1elifFalse: 2else: 3
Because of this, it's currently impossible to test if someone omitted the else block in the statement above. check_part looks for cases where it is None, but will receive an empty list. Should be a quick fix.
The text was updated successfully, but these errors were encountered:
The only problem is that internally, functions like test_while_loop use check_orelse, since they may also have else blocks. Since the else block is missing in most examples, test_while_loop will inappropriately fail.
Should be able to fix by modifying has_part to fail only when no orelse part in both student and submission.
Not that the patch in the fix-check-orelse branch fails for functions like test_for_loop, since they allow for pieces to be empty. (e.g. get the ifs in a list comp, and don't fail if there aren't any).
in most AST nodes, when a missing attribute,
However, the orelse node lives a double life. Sometimes it is a list of expressions, as in...
Sometimes it is a list containing only another If node, as in...
Because of this, it's currently impossible to test if someone omitted the else block in the statement above.
check_part
looks for cases where it is None, but will receive an empty list. Should be a quick fix.The text was updated successfully, but these errors were encountered: