Decorator for multi to remove nodes for original test functions from root node
(f)
| 11 | |
| 12 | |
| 13 | def 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 | |
| 30 | state_dec = state_dec_gen(sct_dict) |