def wrap(f): """ Args: f: Returns: """ _add_phase(phase_name, _handle_entry) MAIN_REPORT['assertions']['phases'].append((section_number, f)) return f
def wrap(f): @wraps(f) def _handle_entry(*args, **kwargs): old_exception_state = MAIN_REPORT['assertions']['exceptions'] MAIN_REPORT['assertions']['exceptions'] = True value = f(*args, **kwargs) MAIN_REPORT['assertions']['exceptions'] = old_exception_state return value _add_phase(phase_name, _handle_entry) _add_relationships(phase_name, before) _add_relationships(after, phase_name) return _handle_entry