Skip to content

Commit 333e99b

Browse files
committed
add example for small number of runs
1 parent 40533d6 commit 333e99b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/team_recommender/tests/example_9_threshold/test_measurement_is_within_threshold.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def test_is_within_expected():
6363
assert not is_within_expected(0.8, 5, 5)
6464
assert is_within_expected(0.8, 26, 100)
6565
assert is_within_expected(0.8, 14, 100)
66+
assert is_within_expected(0.97, 1, 2)
67+
small_size_warning = "after measuring 2x 100 runs and getting 3 failures"
68+
assert not is_within_expected(0.97, 0, 1), small_size_warning
6669

6770

6871
def is_within_expected(success_rate: float, failure_count: int, sample_size: int):
@@ -227,8 +230,8 @@ def run_allocation_test(reporter: Reporter, skills_data, response: str) -> bool:
227230
},
228231
)
229232
return (
230-
developer_is_appropriate
231-
and no_developer_name_is_hallucinated
232-
and not_empty_response
233-
and has_valid_json_schema
233+
developer_is_appropriate
234+
and no_developer_name_is_hallucinated
235+
and not_empty_response
236+
and has_valid_json_schema
234237
)

0 commit comments

Comments
 (0)