code: def test_exec_command_stderr():
      # Test posix version:
      with redirect_stdout(TemporaryFile(mode="w+")):
          with redirect_stderr(StringIO()):
              with assert_warns(DeprecationWarning):
                  exec_command.exec_command("cd '.'")
  
      if os.name == "posix":
          # Test general (non-posix) version:
          with emulate_nonposix():
              with redirect_stdout(TemporaryFile()):
                  with redirect_stderr(StringIO()):
                      with assert_warns(DeprecationWarning):
                          exec_command.exec_command("cd '.'")
  
imports: import os
  import pytest
  import sys
  from tempfile import TemporaryFile
  from numpy.distutils import exec_command
  from numpy.distutils.exec_command import get_pythonexe
  from numpy.testing import tempdir, assert_, assert_warns, IS_WASM
  from io import StringIO
label_desc: Use image node_id 2 for calling a global function with example usage: test_exec_command_stderr() without return types