(
completion: str,
ideal: list[str],
expected_match: bool,
)
| 17 | ], |
| 18 | ) |
| 19 | def test_eval_sample( |
| 20 | completion: str, |
| 21 | ideal: list[str], |
| 22 | expected_match: bool, |
| 23 | ): |
| 24 | eval = Match( |
| 25 | completion_fns=[TestCompletionFn(completion)], |
| 26 | samples_jsonl="", |
| 27 | eval_registry_path=Path("."), |
| 28 | ) |
| 29 | |
| 30 | recorder = DummyRecorder(None) |
| 31 | with recorder.as_default_recorder("x"), patch.object( |
| 32 | recorder, "record_match", wraps=recorder.record_match |
| 33 | ) as record_match: |
| 34 | eval.eval_sample(dict(input="Hello", ideal=ideal), None) |
| 35 | record_match.assert_called_once_with( |
| 36 | expected_match, expected=[ideal], picked=completion, sampled=completion, options=[ideal] |
| 37 | ) |
| 38 | |
| 39 | |
| 40 | @mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…