code: def test_execute_app_commands_raises_appropriate_traceback_on_error(
      capfd,
  ):
      cl = CommandLines(
          file="foo.txt",
          commands=['echo "foo"', 'CommandDoesNotExist "somearg"'],
          line_numbers=[1, 3],
      )
      with pytest.raises(
          MisconfigurationException,
          match='There was a problem on line 3 of foo.txt while executing the command: CommandDoesNotExist "somearg"',
      ):
          _execute_app_commands(cl)
      out, err = capfd.readouterr()
      assert "foo" in out
      if sys.platform.startswith("linux"):
          assert "CommandDoesNotExist: not found" in err
      elif sys.platform.startswith("darwin"):
          assert "CommandDoesNotExist: command not found" in err
      else:
          assert "CommandDoesNotExist' is not recognized" in err
  
file_path: pytorch-lightning/tests/tests_app/utilities/test_app_commands.py
imports: import os
  import sys
  import pytest
  from lightning.app.utilities.app_commands import CommandLines, _execute_app_commands, _extract_commands_from_file
  from lightning.app.utilities.exceptions import MisconfigurationException
label_desc: Use image node_id 5 for calling a global function with example usage: test_execute_app_commands_raises_appropriate_traceback_on_error(capfd) without return types