code: def test_tqdm(self):
      state = {
          torchbearer.EPOCH: 1,
          torchbearer.MAX_EPOCHS: 10,
          torchbearer.TRAIN_STEPS: 100,
          torchbearer.VALIDATION_STEPS: 101,
          torchbearer.METRICS: {"test": 0.99456},
      }
      tqdm = Tqdm(validation_label_letter="e")
      tqdm.tqdm_module = MagicMock()
      mock_tqdm = tqdm.tqdm_module
      state[torchbearer.STEPS] = state[torchbearer.TRAIN_STEPS]
  
      tqdm.on_start_training(state)
      mock_tqdm.assert_called_once_with(total=100, desc="1/10(t)")
  
      tqdm.on_step_training(state)
      mock_tqdm.return_value.set_postfix_str.assert_called_once_with(
          "test=0.9946"
      )
      mock_tqdm.return_value.update.assert_called_once_with(1)
      mock_tqdm.return_value.set_postfix_str.reset_mock()
  
      tqdm.on_end_training(state)
      mock_tqdm.return_value.set_postfix_str.assert_called_once_with(
          "test=0.9946"
      )
      self.assertEqual(mock_tqdm.return_value.close.call_count, 1)
  
      mock_tqdm.reset_mock()
      mock_tqdm.return_value.set_postfix_str.reset_mock()
      mock_tqdm.return_value.update.reset_mock()
      mock_tqdm.return_value.close.reset_mock()
  
      state[torchbearer.STEPS] = state[torchbearer.VALIDATION_STEPS]
      tqdm.on_start_validation(state)
      mock_tqdm.assert_called_once_with(total=101, desc="1/10(e)")
  
      tqdm.on_step_validation(state)
      mock_tqdm.return_value.set_postfix_str.assert_called_once_with(
          "test=0.9946"
      )
      mock_tqdm.return_value.update.assert_called_once_with(1)
      mock_tqdm.return_value.set_postfix_str.reset_mock()
  
      tqdm.on_end_validation(state)
      mock_tqdm.return_value.set_postfix_str.assert_called_once_with(
          "test=0.9946"
      )
      self.assertEqual(mock_tqdm.return_value.close.call_count, 1)
  
file_path: torchbearer/tests/callbacks/test_printer.py
imports: from unittest import TestCase
  from mock import patch, MagicMock
  import torchbearer
  from torchbearer.callbacks import Tqdm, ConsolePrinter
label_desc: Use image node_id 1 for calling the TestTqdm obj's underlying member method code with example usage: obj.test_tqdm() without return types