code: def test_init(test_settings):
      class MyExitError(Exception):
          pass
  
      with patch(
          "wandb.sdk.wandb_init._WandbInit", autospec=True
      ) as mocked_wandbinit:
          with patch(
              "wandb.sdk.wandb_init.logger", autospec=True
          ), patch(
              "wandb.sdk.wandb_init.getcaller", autospec=True
          ), patch(
              "os._exit", side_effect=MyExitError("")
          ), patch(
              "wandb._sentry.exception", autospec=True
          ), patch(
              "wandb._assert_is_user_process", side_effect=lambda: None
          ):
              instance = mocked_wandbinit.return_value
              instance.settings = test_settings(
                  {"_except_exit": True, "problem": "fatal"}
              )
              instance.setup.side_effect = lambda *_: None
              instance.init.side_effect = Exception("test")
              with pytest.raises(MyExitError):
                  wandb.init()
  
file_path: wandb/tests/pytest_tests/unit_tests/test_wandb_init.py
imports: from unittest.mock import MagicMock, patch
  import pytest
  import wandb
  from wandb.errors import Error
  from wandb.proto import wandb_internal_pb2
  from wandb.sdk.wandb_init import _WandbInit
label_desc: Use image node_id 1 for calling a global function with example usage: test_init(test_settings) without return types