code: def test_loggers_fit_test_all(
      logger_class,
      mlflow_mock,
      wandb_mock,
      comet_mock,
      neptune_mock,
      tmp_path,
  ):
      """Verify that basic functionality of all loggers."""
  
      class CustomModel(BoringModel):
          def training_step(self, batch, batch_idx):
              loss = self.step(batch)
              self.log("train_some_val", loss)
              return {"loss": loss}
  
          def on_validation_epoch_end(self):
              self.log_dict(
                  {
                      "early_stop_on": torch.tensor(1),
                      "val_loss": torch.tensor(0.5),
                  }
              )
  
          def on_test_epoch_end(self):
              self.log("test_loss", torch.tensor(2))
  
      class StoreHistoryLogger(logger_class):
          def __init__(self, *args, **kwargs) -> None:
              super().__init__(*args, **kwargs)
              self.history = []
  
          def log_metrics(self, metrics, step):
              super().log_metrics(metrics, step)
              self.history.append((step, metrics))
  
      logger_args = _get_logger_args(logger_class, tmp_path)
      logger = StoreHistoryLogger(**logger_args)
  
      if logger_class == WandbLogger:
          # required mocks for Trainer
          logger.experiment.id = "foo"
          logger.experiment.name = "bar"
  
      if logger_class == CometLogger:
          logger.experiment.id = "foo"
          logger.experiment.project_name = "bar"
  
      if logger_class == NeptuneLogger:
          logger._retrieve_run_data = Mock()
          logger._run_short_id = "foo"
          logger._run_name = "bar"
  
      if logger_class == MLFlowLogger:
          logger = mock_mlflow_run_creation(
              logger, experiment_id="foo", run_id="bar"
          )
  
      model = CustomModel()
      trainer = Trainer(
          max_epochs=1,
          logger=logger,
          limit_train_batches=1,
          limit_val_batches=1,
          log_every_n_steps=1,
          default_root_dir=tmp_path,
      )
      trainer.fit(model)
      trainer.test()
  
      log_metric_names = [
          (s, sorted(m.keys())) for s, m in logger.history
      ]
      if logger_class == TensorBoardLogger:
          expected = [
              (0, ["epoch", "train_some_val"]),
              (0, ["early_stop_on", "epoch", "val_loss"]),
              (1, ["epoch", "test_loss"]),
          ]
          assert log_metric_names == expected
      else:
          expected = [
              (0, ["epoch", "train_some_val"]),
              (0, ["early_stop_on", "epoch", "val_loss"]),
              (1, ["epoch", "test_loss"]),
          ]
          assert log_metric_names == expected
  
imports: import inspect
  import os
  import pickle
  from unittest import mock
  from unittest.mock import ANY, Mock
  import pytest
  import torch
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import CometLogger, CSVLogger, MLFlowLogger, NeptuneLogger, TensorBoardLogger, WandbLogger
  from lightning.pytorch.loggers.logger import DummyExperiment, Logger
  from lightning.pytorch.loggers.tensorboard import _TENSORBOARD_AVAILABLE
  from lightning.pytorch.tuner.tuning import Tuner
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.loggers.test_comet import _patch_comet_atexit
  from tests_pytorch.loggers.test_mlflow import mock_mlflow_run_creation
label_desc: Use image node_id 3 for calling a global function with example usage: test_loggers_fit_test_all(logger_class, mlflow_mock, wandb_mock, comet_mock, neptune_mock, tmp_path) and returns: dict