(
completion: str,
ideal: list[str],
expected_metrics: dict[str, float],
)
| 60 | ], |
| 61 | ) |
| 62 | def test_eval_sample( |
| 63 | completion: str, |
| 64 | ideal: list[str], |
| 65 | expected_metrics: dict[str, float], |
| 66 | ) -> None: |
| 67 | eval = JsonMatch( |
| 68 | completion_fns=[TestCompletionFn(completion)], |
| 69 | samples_jsonl="", |
| 70 | eval_registry_path=Path("."), |
| 71 | ) |
| 72 | |
| 73 | recorder = DummyRecorder(None) |
| 74 | with recorder.as_default_recorder("x"), patch.object( |
| 75 | recorder, "record_metrics", wraps=recorder.record_metrics |
| 76 | ) as record_metrics: |
| 77 | eval.eval_sample(dict(input=completion, ideal=ideal), None) |
| 78 | record_metrics.assert_called_once_with(**expected_metrics) |
| 79 | |
| 80 | |
| 81 | @mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…