code: def _test_execute(self, parallelism, success_command, fail_command):
      executor = LocalExecutor(parallelism=parallelism)
      executor.start()
  
      success_key = "success {}"
      assert executor.result_queue.empty()
  
      execution_date = datetime.datetime.now()
      for i in range(self.TEST_SUCCESS_COMMANDS):
          key_id, command = success_key.format(i), success_command
          key = key_id, "fake_ti", execution_date, 0
          executor.running.add(key)
          executor.execute_async(key=key, command=command)
  
      fail_key = "fail", "fake_ti", execution_date, 0
      executor.running.add(fail_key)
      executor.execute_async(key=fail_key, command=fail_command)
  
      executor.end()
      # By that time Queues are already shutdown so we cannot check if they are empty
      assert len(executor.running) == 0
  
      for i in range(self.TEST_SUCCESS_COMMANDS):
          key_id = success_key.format(i)
          key = key_id, "fake_ti", execution_date, 0
          assert executor.event_buffer[key][0] == State.SUCCESS
      assert executor.event_buffer[fail_key][0] == State.FAILED
  
      expected = (
          self.TEST_SUCCESS_COMMANDS + 1
          if parallelism == 0
          else parallelism
      )
      assert executor.workers_used == expected
  
imports: from __future__ import annotations
  import datetime
  import subprocess
  from unittest import mock
  import pytest
  from airflow import settings
  from airflow.exceptions import AirflowException
  from airflow.executors.local_executor import LocalExecutor
  from airflow.utils.state import State
label_desc: Use image node_id 7 for calling the TestLocalExecutor obj's underlying member method code with example usage: obj._test_execute(parallelism, success_command, fail_command) without return types