code: def test_sync(self, run_task_mock):
      run_task_mock.return_value = True
  
      executor = DebugExecutor()
  
      ti1 = MagicMock(key="t1")
      ti2 = MagicMock(key="t2")
      executor.tasks_to_run = [ti1, ti2]
  
      executor.sync()
      assert not executor.tasks_to_run
      run_task_mock.assert_has_calls([mock.call(ti1), mock.call(ti2)])
  
file_path: airflow/tests/executors/test_debug_executor.py
imports: from __future__ import annotations
  from unittest import mock
  from unittest.mock import MagicMock
  from airflow.executors.debug_executor import DebugExecutor
  from airflow.utils.state import State
label_desc: Use image node_id 1 for calling the TestDebugExecutor obj's underlying member method code with example usage: obj.test_sync(run_task_mock) without return types