code: def test_optimizer_params_handler_wrong_setup():
      with pytest.raises(TypeError):
          OptimizerParamsHandler(optimizer=None)
  
      optimizer = MagicMock(spec=torch.optim.Optimizer)
      handler = OptimizerParamsHandler(optimizer=optimizer)
  
      mock_logger = MagicMock()
      mock_engine = MagicMock()
      with pytest.raises(
          RuntimeError,
          match="Handler OptimizerParamsHandler works only with VisdomLogger",
      ):
          handler(mock_engine, mock_logger, Events.ITERATION_STARTED)
  
imports: import sys
  from unittest.mock import ANY, call, MagicMock, patch
  import pytest
  import torch
  from ignite.contrib.handlers.visdom_logger import _DummyExecutor, global_step_from_engine, GradsScalarHandler, OptimizerParamsHandler, OutputHandler, VisdomLogger, WeightsScalarHandler
  from ignite.engine import Engine, Events, State
label_desc: Use image node_id 1 for calling a global function with example usage: test_optimizer_params_handler_wrong_setup() without return types