def test_optimization_result_astuple() -> None: opt_result: OptimizationResult[None] = OptimizationResult( Err(_Whoops()), [Record({}, {}, None)] ) final_result, history = opt_result.astuple() assert final_result is opt_result.final_result assert history is opt_result.history
def test_optimization_result_try_get_final_datasets_for_failed_optimization( ) -> None: result: OptimizationResult[object] = OptimizationResult(Err(_Whoops()), []) with pytest.raises(_Whoops): result.try_get_final_datasets()