def test_log_metrics_epoch_step_values(mock_log_metrics, tmp_path):
    """Tests the default epoch and step values logged."""

    class MyModel(BoringModel):
        def training_step(self, batch, batch_idx):
            self.log("foo", 0.0, on_step=True, on_epoch=True)
            return super().training_step(batch, batch_idx)

    model = MyModel()
    trainer = Trainer(
        default_root_dir=tmp_path,
        limit_train_batches=2,
        limit_val_batches=0,
        max_epochs=2,
        log_every_n_steps=1,
        enable_model_summary=False,
        enable_checkpointing=False,
        enable_progress_bar=False,
        logger=TensorBoardLogger(tmp_path),
    )
    trainer.fit(model)

    mock_log_metrics.assert_has_calls([
        call(metrics={"foo_step": 0.0, "epoch": 0}, step=0),
        call(metrics={"foo_step": 0.0, "epoch": 0}, step=1),
        call(metrics={"foo_epoch": 0.0, "epoch": 0}, step=1),
        call(metrics={"foo_step": 0.0, "epoch": 1}, step=2),
        call(metrics={"foo_step": 0.0, "epoch": 1}, step=3),
        call(metrics={"foo_epoch": 0.0, "epoch": 1}, step=3),
    ])
Tests the default epoch and step values logged.
tests/tests_pytorch/trainer/logging_/test_train_loop_logging.py