Skip to content

Commit e8c124d

Browse files
committed
update
1 parent 9498c61 commit e8c124d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/diffusers/utils/testing_utils.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,18 @@ def summary_failures_short(tr):
991991

992992

993993
# Adapted from https://github.com/huggingface/transformers/blob/000e52aec8850d3fe2f360adc6fd256e5b47fe4c/src/transformers/testing_utils.py#L1905
994-
def is_flaky(
995-
max_attempts: int = 5,
996-
wait_before_retry: Optional[float] = None,
997-
description: Optional[str] = None,
998-
):
994+
def is_flaky(max_attempts: int = 5, wait_before_retry: Optional[float] = None, description: Optional[str] = None):
999995
"""
1000996
To decorate flaky tests (methods or entire classes). They will be retried on failures.
997+
998+
Args:
999+
max_attempts (`int`, *optional*, defaults to 5):
1000+
The maximum number of attempts to retry the flaky test.
1001+
wait_before_retry (`float`, *optional*):
1002+
If provided, will wait that number of seconds before retrying the test.
1003+
description (`str`, *optional*):
1004+
A string to describe the situation (what / where / why is flaky, link to GH issue/PR comments, errors,
1005+
etc.)
10011006
"""
10021007

10031008
def decorator(obj):
@@ -1026,7 +1031,6 @@ def wrapper(*args, **kwargs):
10261031
time.sleep(wait_before_retry)
10271032
retry_count += 1
10281033

1029-
# final attempt, let any exception bubble up
10301034
return obj(*args, **kwargs)
10311035

10321036
return wrapper

0 commit comments

Comments
 (0)