test: retry flaky password_strength test thrice

This commit is contained in:
Ankush Menat 2023-12-20 13:57:48 +05:30
parent b51a479fc2
commit 02f3fd8470

View file

@ -3,10 +3,18 @@ from string import printable
from time import time
from unittest import TestCase
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_fixed
from frappe.utils.password_strength import test_password_strength
class TestPasswordStrength(TestCase):
@retry(
retry=retry_if_exception_type(AssertionError),
stop=stop_after_attempt(3),
wait=wait_fixed(0.5),
reraise=True,
)
def test_long_password(self):
password = "".join(random.choice(printable) for _ in range(600))