old_contents: # Tai Sakuma <tai.sakuma@gmail.com>
  import sys
  
  import pytest
  
  try:
      import unittest.mock as mock
  except ImportError:
      import mock
  
  from alphatwirl.progressbar import BProgressMonitor, ProgressReporter, ProgressReport
  
  import alphatwirl
  
  ##__________________________________________________________________||
  @pytest.fixture()
  def presentation():
      ret = mock.MagicMock()
      return ret
  
  @pytest.fixture()
  def monitor(presentation):
      return BProgressMonitor(presentation)
  
  
  ##__________________________________________________________________||
  def test_repr(monitor):
      repr(monitor)
  
  def test_begin_end(monitor, presentation):
      presentation.active.return_value = False
      monitor.begin()
      assert isinstance(alphatwirl.progressbar._progress_reporter, ProgressReporter)
      monitor.end()
      assert alphatwirl.progressbar._progress_reporter is None
  
  def test_create_reporter(monitor):
      reporter = monitor.create_reporter()
      assert isinstance(reporter, ProgressReporter)
  
  def test_send_report(monitor, presentation):
      presentation.active.return_value = True
      monitor.begin()
      reporter = monitor.create_reporter()
      report = ProgressReport('task1', 0, 3)
      reporter.report(report)
      monitor.end()
  
  ##__________________________________________________________________||
  
new_contents: # Tai Sakuma <tai.sakuma@gmail.com>
  import sys
  
  import pytest
  
  try:
      import unittest.mock as mock
  except ImportError:
      import mock
  
  from alphatwirl.progressbar import BProgressMonitor, ProgressReporter, ProgressReport
  
  import alphatwirl
  
  ##__________________________________________________________________||
  @pytest.fixture()
  def presentation():
      ret = mock.Mock()
      return ret
  
  @pytest.fixture()
  def obj(presentation):
      return BProgressMonitor(presentation)
  
  ##__________________________________________________________________||
  def test_repr(obj):
      repr(obj)
  
  def test_begin_end(obj, presentation):
      presentation.active.return_value = False
      obj.begin()
      assert isinstance(alphatwirl.progressbar._progress_reporter, ProgressReporter)
      obj.end()
      assert alphatwirl.progressbar._progress_reporter is None
  
  def test_create_reporter(obj):
      reporter = obj.create_reporter()
      assert isinstance(reporter, ProgressReporter)
  
  def test_send_report(obj, presentation):
      presentation.active.return_value = True
      obj.begin()
      reporter = obj.create_reporter()
      report = ProgressReport('task1', 0, 3)
      reporter.report(report)
      obj.end()
  
  ##__________________________________________________________________||
  
subject: clean up code in test_BProgressMonitor.py