code: def test(self) -> None:
      callback = MetricCallback()
      trainer = Trainer(
          accelerator="cpu", callbacks=[callback], max_epochs=3
      )
      dataset = FakeData(
          size=10,
          image_size=(3, 32, 32),
          num_classes=10,
          transform=ToTensor(),
      )
      train_dataloader = DataLoader(dataset, batch_size=2)
      val_dataloader = DataLoader(dataset, batch_size=2)
      trainer.fit(
          _DummyModule(),
          train_dataloaders=train_dataloader,
          val_dataloaders=val_dataloader,
      )
      assert callback.train_metrics["train_epoch"] == [0, 1, 2]
      assert callback.train_metrics["train_epoch_dict"] == [0, 1, 2]
      # test logs 2 * epoch in validation step
      assert callback.val_metrics["val_epoch"] == [0, 2, 4]
      assert callback.val_metrics["val_epoch_dict"] == [0, 2, 4]
  
file_path: lightly/tests/utils/benchmarking/test_metric_callback.py
imports: import torch
  from pytorch_lightning import LightningModule, Trainer
  from torch.utils.data import DataLoader
  from torchvision.datasets import FakeData
  from torchvision.transforms import ToTensor
  from lightly.utils.benchmarking import MetricCallback
label_desc: Use image node_id 1 for calling the TestMetricCallback obj's underlying member method code with example usage: obj.test() without return types