class_docstr: These tests don't spawn children or hang.
docstr: Test that spawn resets the tty mode no when _copy returns normally.
docstr_tok: ["Test","that","spawn","resets","the","tty","mode","no","when","_copy","returns","normally","."]
code: def test__restore_tty_mode_normal_return(self):
      """Test that spawn resets the tty mode no when _copy returns normally."""
  
      # PID 1 is returned from mocked fork to run the parent branch
      # of code
      pty.fork = self._make_mock_fork(1)
  
      status_sentinel = object()
      pty.waitpid = lambda _1, _2: [None, status_sentinel]
      pty.close = lambda _: None
  
      pty._copy = lambda _1, _2, _3: None
  
      mode_sentinel = object()
      pty.tcgetattr = lambda fd: mode_sentinel
      pty.tcsetattr = self._mock_tcsetattr
      pty.setraw = lambda _: None
  
      self.assertEqual(
          pty.spawn([]),
          status_sentinel,
          "pty.waitpid process status not returned by pty.spawn",
      )
      self.assertEqual(
          self.tcsetattr_mode_setting,
          mode_sentinel,
          "pty.tcsetattr not called with original mode value",
      )
  
imports: from test.support import verbose, reap_children
  from test.support.import_helper import import_module
  import errno
  import os
  import pty
  import tty
  import sys
  import select
  import signal
  import socket
  import io
  import unittest
  import warnings
label_desc: Use image node_id 9 for calling the SmallPtyTests obj's underlying member method code with example usage: obj.test__restore_tty_mode_normal_return() without return types