code: def test_run_loop():
      s = mock.MagicMock()
      # run loop checks on this
      s.bankrupt = False
      data = pd.DataFrame(
          index=pd.date_range("2010-01-01", periods=5),
          columns=["a", "b"],
          data=100,
      )
  
      actual = bt.Backtest(
          s, data, initial_capital=302, progress_bar=False
      )
      actual.run()
  
      s = actual.strategy
  
      # account for first update call to 'setup' initial state
      assert s.update.call_count == 10 + 1
      assert s.run.call_count == 5
  
file_path: bt/tests/test_backtest.py
imports: from __future__ import division
  import numpy
  import pandas
  import pytest
  import random
  from unittest import mock
  import bt
label_desc: Use image node_id 5 for calling a global function with example usage: test_run_loop() without return types