code: def test_ssh_option():
      # This test is hacky in that detecting the sent value depends on systems
      # commonly configuring `AcceptEnv LC_*` in their sshd_config. If we get
      # back an empty value, assume that isn't configured, and skip the test.
      with patch.dict("os.environ", {"LC_DATALAD_HACK": "hackbert"}):
          with swallow_outputs() as cmo:
              with assert_raises(SystemExit):
                  main(
                      [
                          "datalad",
                          "sshrun",
                          "-oSendEnv=LC_DATALAD_HACK",
                          "datalad-test",
                          "echo $LC_DATALAD_HACK",
                      ]
                  )
              out = cmo.out.strip()
              if not out:
                  raise SkipTest(
                      "SSH target probably does not accept LC_* variables. "
                      "Skipping"
                  )
              assert_equal(out, "hackbert")
  
file_path: datalad/datalad/support/tests/test_sshrun.py
imports: import sys
  from io import StringIO, UnsupportedOperation
  import pytest
  from unittest.mock import patch
  from datalad.api import sshrun
  from datalad.cli.main import main
  from datalad.cmd import StdOutCapture, WitlessRunner
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_raises, skip_if_on_windows, skip_ssh, swallow_outputs, with_tempfile
label_desc: Use image node_id 4 for calling a global function with example usage: test_ssh_option() without return types