From ece6f7ea6b71f970854a3dfaa243b40138629eaa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 10 Jan 2026 05:18:36 +0530 Subject: [PATCH] ... --- src/calibre/srv/tests/base.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/calibre/srv/tests/base.py b/src/calibre/srv/tests/base.py index acdd0c7b33..d371d46fcd 100644 --- a/src/calibre/srv/tests/base.py +++ b/src/calibre/srv/tests/base.py @@ -29,17 +29,15 @@ def retry(max_attempts=3, delay=0): def decorator(test_func): @wraps(test_func) def wrapper(*args, **kwargs): - last_exception = None for attempt in range(max_attempts): try: return test_func(*args, **kwargs) except AssertionError as e: - last_exception = e if attempt < max_attempts - 1: + print(f'Retry ({attempt + 1}/{max_attempts-1}) on {test_func} failure with error: {e}') time.sleep(delay) - print(f'Retry {attempt + 1}/{max_attempts - 1}') else: - raise last_exception + raise return wrapper return decorator