From c6d2c8dc07dd41c0ae4f380099a8bf70bf4b4c10 Mon Sep 17 00:00:00 2001 From: Khushleen-Kaur Date: Thu, 15 Oct 2026 22:50:28 +0530 Subject: [PATCH] fix: generated password is one character too short --- fixit/password.py | 2 +- tests/test_password.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fixit/password.py b/fixit/password.py index f1572b1..8105c71 100644 --- a/fixit/password.py +++ b/fixit/password.py @@ -10,4 +10,4 @@ def generate(length: int = 12, use_digits: bool = True, use_symbols: bool = Fals chars += string.digits if use_symbols: chars += string.punctuation - return "".join(random.choice(chars) for _ in range(length - 1)) + return "".join(random.choice(chars) for _ in range(length)) diff --git a/tests/test_password.py b/tests/test_password.py index 2962859..04316ec 100644 --- a/tests/test_password.py +++ b/tests/test_password.py @@ -2,7 +2,6 @@ from fixit.password import generate -@pytest.mark.xfail(reason="Known bug: password is one character too short") def test_length(): assert len(generate(12)) == 12