code: def test_dir_on_init_dir(wandb_init):
      """Ensure that `wandb.init(dir=DIR)` creates the proper directory and nothing else."""
      default_path = os.path.join(os.getcwd(), "wandb")
      dir_name = "dir_custom"
      custom_dir_path = os.path.join(os.getcwd(), dir_name)
  
      # test for the case that the dir is set
      reload_fn(wandb)
      _remove_dir_if_exists(default_path)
      if not os.path.isdir(custom_dir_path):
          os.makedirs(custom_dir_path)
      run = wandb_init(dir="./" + dir_name)
      run.finish()
      assert not os.path.isdir(
          default_path
      ), f"Unexpected directory at {default_path}"
      assert os.path.isdir(
          custom_dir_path
      ), f"Expected directory at {custom_dir_path}"
      # And for the duplicate-run case
      _remove_dir_if_exists(default_path)
      run = wandb_init(dir="./" + dir_name)
      run.finish()
      assert not os.path.isdir(
          default_path
      ), f"Unexpected directory at {default_path}"
      assert os.path.isdir(
          custom_dir_path
      ), f"Expected directory at {custom_dir_path}"
  
file_path: wandb/tests/pytest_tests/system_tests/test_core/test_wandb_integration.py
imports: import importlib
  import os
  import shutil
  import time
  from unittest import mock
  import pytest
  import wandb
  import wandb.env
label_desc: Use image node_id 7 for calling a global function with example usage: test_dir_on_init_dir(wandb_init) without return types