def test_log_dir_no_logger_no_checkpoint(tmp_path):
    """Tests that the path is correct even when there is no logger."""
    expected = str(tmp_path)
    model = TestModel(expected)

    trainer = Trainer(default_root_dir=tmp_path, max_steps=2, logger=False, enable_checkpointing=False)

    assert trainer.log_dir == expected
    trainer.fit(model)
    assert trainer.log_dir == expected
Tests that the path is correct even when there is no logger.
tests/tests_pytorch/trainer/properties/test_log_dir.py