nirtal85/Selenium-Python-Example

retry in mailinator using Tenacity

nirtal85 opened this issue · 0 comments

https://paragkamble.medium.com/retry-flaky-task-in-python-using-tenacity-c6fabcf9a3be

from tenacity import retry, retry_if_result

def is_none_p(value):
    """Return True if value is None"""
    return value is None

@retry(retry=retry_if_result(is_none_p))
def might_return_none():
    print("Retry with no wait if return value is None")