MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / wrapper

Function wrapper

src/diffusers/utils/testing_utils.py:701–714  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

699 def decorator(test_func_ref):
700 @functools.wraps(test_func_ref)
701 def wrapper(*args, **kwargs):
702 retry_count = 1
703
704 while retry_count < max_attempts:
705 try:
706 return test_func_ref(*args, **kwargs)
707
708 except Exception as err:
709 print(f"Test failed with {err} at try {retry_count}/{max_attempts}.", file=sys.stderr)
710 if wait_before_retry is not None:
711 time.sleep(wait_before_retry)
712 retry_count += 1
713
714 return test_func_ref(*args, **kwargs)
715
716 return wrapper
717

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected