@skip_if_windows
        @patch('invoke.platform.tty') # stub
        @patch('invoke.platform.termios')
        def tty_stdins_have_settings_restored_on_KeyboardInterrupt(
            self, mock_termios, mock_tty
        ):
            # This test is re: GH issue #303
            # tcgetattr returning some arbitrary value
            sentinel = [1, 7, 3, 27]
            mock_termios.tcgetattr.return_value = sentinel
            # Don't actually bubble up the KeyboardInterrupt...
            try:
                self._run(_, klass=_KeyboardInterruptingRunner)
            except __HOLE__:
                pass
            # Did we restore settings?!
            mock_termios.tcsetattr.assert_called_once_with(
                sys.stdin, mock_termios.TCSADRAIN, sentinel
            )
dataset/ETHPy150Open pyinvoke/invoke/tests/runners.py/Runner_.character_buffered_stdin.tty_stdins_have_settings_restored_on_KeyboardInterrupt