code: def test_close_dont_kill_finished(self):
      async def kill_running():
          create = self.loop.subprocess_exec(
              asyncio.SubprocessProtocol, *PROGRAM_BLOCKED
          )
          transport, protocol = await create
          proc = transport.get_extra_info("subprocess")
  
          # kill the process (but asyncio is not notified immediately)
          proc.kill()
          proc.wait()
  
          proc.kill = mock.Mock()
          proc_returncode = proc.poll()
          transport_returncode = transport.get_returncode()
          transport.close()
          return (
              proc_returncode,
              transport_returncode,
              proc.kill.called,
          )
  
      # Ignore "Unknown child process pid ..." log of SafeChildWatcher,
      # emitted because the test already consumes the exit status:
      # proc.wait()
      with test_utils.disable_logger():
          result = self.loop.run_until_complete(kill_running())
          test_utils.run_briefly(self.loop)
  
      proc_returncode, transport_return_code, killed = result
  
      self.assertIsNotNone(proc_returncode)
      self.assertIsNone(transport_return_code)
  
      # transport.close() must not kill the process if it finished, even if
      # the transport was not notified yet
      self.assertFalse(killed)
  
      # Unlike SafeChildWatcher, FastChildWatcher does not pop the
      # callbacks if waitpid() is called elsewhere. Let's clear them
      # manually to avoid a warning when the watcher is detached.
      if sys.platform != "win32" and isinstance(
          self, SubprocessFastWatcherTests
      ):
          with warnings.catch_warnings():
              warnings.simplefilter("ignore", DeprecationWarning)
              asyncio.get_child_watcher()._callbacks.clear()
  
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 23 for calling the SubprocessMixin obj's underlying member method code with example usage: obj.test_close_dont_kill_finished() and returns: proc_returncode,  transport_returncode,  proc