def test_log_dir(tmp_path):
    """Tests that the path is correct when checkpoint and loggers are used."""
    expected = str(tmp_path / "lightning_logs" / "version_0")

    model = TestModel(expected)

    trainer = Trainer(default_root_dir=tmp_path, max_steps=2, callbacks=[ModelCheckpoint(dirpath=tmp_path)])

    assert trainer.log_dir == expected
    trainer.fit(model)
    assert trainer.log_dir == expected
Tests that the path is correct when checkpoint and loggers are used.
tests/tests_pytorch/trainer/properties/test_log_dir.py