def METHOD_NAME(self, loss_params, metric_params, handler_params, expected_avg):
    loss_fn = DiceLoss(**loss_params)
    metric_fn = LossMetric(loss_fn=loss_fn, **metric_params)
    ignite_metric = IgniteMetricHandler(metric_fn=metric_fn, **handler_params)
    def _val_func(engine, batch):
        pass
    engine = Engine(_val_func)
    ignite_metric.attach(engine=engine, name="ignite_dice_loss")
    y_pred = torch.tensor([[[[0.0, 1.0]], [[1.0, 0.0]]]])
    y = torch.tensor([[[[0.0, 1.0]], [[0.0, 1.0]]]])
    engine.state.output = {"pred": y_pred, "label": y}
    engine.fire_event(Events.ITERATION_COMPLETED)
    y_pred = torch.tensor([[[[0.0, 1.0]], [[1.0, 0.0]]]])
    y = torch.tensor([[[[0.0, 1.0]], [[1.0, 0.0]]]])
    engine.state.output = {"pred": y_pred, "label": y}
    engine.fire_event(Events.ITERATION_COMPLETED)
    engine.fire_event(Events.EPOCH_COMPLETED)
    assert_allclose(engine.state.metrics["ignite_dice_loss"], expected_avg, atol=1e-4, rtol=1e-4, type_test=False)