code: def test_wandb_project_name(wandb_mock):
      with mock.patch.dict(os.environ, {}):
          logger = WandbLogger()
      assert logger.name == "lightning_logs"
  
      with mock.patch.dict(os.environ, {}):
          logger = WandbLogger(project="project")
      assert logger.name == "project"
  
      with mock.patch.dict(
          os.environ, {"WANDB_PROJECT": "env_project"}
      ):
          logger = WandbLogger()
      assert logger.name == "env_project"
  
      with mock.patch.dict(
          os.environ, {"WANDB_PROJECT": "env_project"}
      ):
          logger = WandbLogger(project="project")
      assert logger.name == "project"
  
imports: import os
  import pickle
  from unittest import mock
  import pytest
  import yaml
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.cli import LightningCLI
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import WandbLogger
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning_utilities.test.warning import no_warning_call
label_desc: Use image node_id 1 for calling a global function with example usage: test_wandb_project_name(wandb_mock) without return types