code: def test_no_stdin_swallow(fname=None):
      # will relay actual exit code on CommandError
      cmd = ["datalad", "sshrun", "datalad-test", "cat"]
  
      out = WitlessRunner().run(
          cmd, stdin=open(fname), protocol=StdOutCapture
      )
      assert_equal(out["stdout"].rstrip(), "123magic")
  
      # test with -n switch now, which we could place even at the end
      out = WitlessRunner().run(
          cmd + ["-n"], stdin=open(fname), protocol=StdOutCapture
      )
      assert_equal(out["stdout"], "")
  
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 2 for calling a global function with example usage: test_no_stdin_swallow(fname) without return types