MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / multi_dec

Function multi_dec

pythonwhat/sct_syntax.py:13–27  ·  view source on GitHub ↗

Decorator for multi to remove nodes for original test functions from root node

(f)

Source from the content-addressed store, hash-verified

11
12
13def multi_dec(f):
14 """Decorator for multi to remove nodes for original test functions from root node"""
15
16 @wraps(f)
17 def wrapper(*args, **kwargs):
18 args = (
19 args[0] if len(args) == 1 and isinstance(args[0], (list, tuple)) else args
20 )
21 for arg in args:
22 if isinstance(arg, Node) and arg.parent.name == "root":
23 arg.parent.remove_child(arg)
24 arg.update_child_calls()
25 return f(*args, **kwargs)
26
27 return wrapper
28
29
30state_dec = state_dec_gen(sct_dict)

Callers 1

sct_syntax.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected