code: def test_send_signal(self):
      # bpo-31034: Make sure that we get the default signal handler (killing
      # the process). The parent process may have decided to ignore SIGHUP,
      # and signal handlers are inherited.
      old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL)
      try:
          code = 'import time; print("sleeping", flush=True); time.sleep(3600)'
          args = [sys.executable, "-c", code]
          proc = self.loop.run_until_complete(
              asyncio.create_subprocess_exec(
                  *args,
                  stdout=subprocess.PIPE,
              )
          )
  
          async def send_signal(proc):
              # basic synchronization to wait until the program is sleeping
              line = await proc.stdout.readline()
              self.assertEqual(line, b"sleeping\n")
  
              proc.send_signal(signal.SIGHUP)
              returncode = await proc.wait()
              return returncode
  
          returncode = self.loop.run_until_complete(send_signal(proc))
          self.assertEqual(-signal.SIGHUP, returncode)
      finally:
          signal.signal(signal.SIGHUP, old_handler)
  
imports: import os
  import signal
  import sys
  import textwrap
  import unittest
  import warnings
  from unittest import mock
  import asyncio
  from asyncio import base_subprocess
  from asyncio import subprocess
  from test.test_asyncio import utils
  from test import support
  from test.support import os_helper
label_desc: Use image node_id 9 for calling the SubprocessMixin obj's underlying member method code with example usage: obj.test_send_signal() and returns: returncode