code: def test_writer_closed_on_end_visdom_visdom(
      self, mock_visdom, mock_writer, _
  ):
      mock_writer.return_value = Mock()
      mock_writer.return_value.close = Mock()
  
      state = {torchbearer.MODEL: nn.Sequential(nn.Conv2d(3, 3, 3))}
  
      tboard = TensorBoard(visdom=True)
      tboard.on_start(state)
      tboard.on_end({})
      self.assertEqual(mock_writer.return_value.close.call_count, 1)
  
imports: import os
  from unittest import TestCase
  import warnings
  import torch
  import torch.nn
  from mock import patch, Mock, ANY, MagicMock
  import torchbearer
  from torchbearer.callbacks import TensorBoard, TensorBoardImages, TensorBoardProjector, TensorBoardText
label_desc: Use image node_id 4 for calling the TestTensorBoardImages obj's underlying member method code with example usage: obj.test_writer_closed_on_end_visdom_visdom(mock_visdom, mock_writer, _) without return types