def test_wandb_logger_offline_log_model(wandb_mock, tmp_path):
    """Test that log_model=True raises an error in offline mode."""
    with pytest.raises(MisconfigurationException, match="checkpoints cannot be uploaded in offline mode"):
        _ = WandbLogger(save_dir=tmp_path, offline=True, log_model=True)
Test that log_model=True raises an error in offline mode.
tests/tests_pytorch/loggers/test_wandb.py