diff --git a/tests/test_optional.py b/tests/test_optional.py index f84bcdb3c5..2abf3ba65b 100644 --- a/tests/test_optional.py +++ b/tests/test_optional.py @@ -6,8 +6,9 @@ class TestOptionalClass: def test_optional(self) -> None: fake = Faker() - - assert {fake.optional.boolean() for _ in range(10)} == {True, False, None} + # 100 draws; 10 drew ~12% failure rate (GH-2366) + values = {fake.optional.boolean() for _ in range(100)} + assert values == {True, False, None} def test_optional_probability(self) -> None: """The probability is configurable."""