(
completion: str,
ideal: list[str],
expected_match: bool,
)
| 44 | ], |
| 45 | ) |
| 46 | def test_eval_sample_2( |
| 47 | completion: str, |
| 48 | ideal: list[str], |
| 49 | expected_match: bool, |
| 50 | ): |
| 51 | eval = Match( |
| 52 | completion_fns=[TestCompletionFn(completion)], |
| 53 | samples_jsonl="", |
| 54 | eval_registry_path=Path("."), |
| 55 | ) |
| 56 | |
| 57 | recorder = DummyRecorder(None) |
| 58 | with recorder.as_default_recorder("x"), patch.object( |
| 59 | recorder, "record_match", wraps=recorder.record_match |
| 60 | ) as record_match: |
| 61 | eval.eval_sample(dict(input="Hello", ideal=ideal), None) |
| 62 | record_match.assert_called_once_with( |
| 63 | expected_match, expected=ideal, picked=completion, sampled=completion, options=ideal |
| 64 | ) |
| 65 | |
| 66 | |
| 67 | @mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…