Skip to content

Commit ac43fd3

Browse files
ashok672Copilot
andauthored
Update tests/test_oidc.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b691ae5 commit ac43fd3

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

tests/test_oidc.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ def test_pkce_code_verifier_respects_custom_length(self):
3131

3232
def test_pkce_code_verifier_can_have_repeated_characters(self):
3333
"""secrets.choice() samples with replacement, unlike the old random.sample()."""
34-
seen_repeat = False
35-
for _ in range(100):
36-
result = _generate_pkce_code_verifier(128)
37-
if len(set(result["code_verifier"])) < len(result["code_verifier"]):
38-
seen_repeat = True
39-
break
40-
self.assertTrue(seen_repeat,
34+
result = _generate_pkce_code_verifier(128)
35+
code_verifier = result["code_verifier"]
36+
self.assertLess(len(set(code_verifier)), len(code_verifier),
4137
"At length 128 with a 66-char alphabet, repeated chars are expected")
4238

4339
def test_pkce_code_verifier_is_not_deterministic(self):

0 commit comments

Comments
 (0)