Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions Lib/test/test_pyrepl/eio_test_script.py

This file was deleted.

35 changes: 1 addition & 34 deletions Lib/test/test_pyrepl/test_unix_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
import itertools
import os
import signal
import subprocess
import sys
import threading
import unittest
from functools import partial
from test import support
from test.support import os_helper, force_not_colorized_test_class
from test.support import script_helper, threading_helper
from test.support import threading_helper

from unittest import TestCase
from unittest.mock import MagicMock, call, patch, ANY, Mock
Expand Down Expand Up @@ -369,34 +367,3 @@ def test_eio_error_handling_in_restore(self, mock_tcgetattr, mock_tcsetattr):

# EIO error should be handled gracefully in restore()
console.restore()

@unittest.skipUnless(sys.platform == "linux", "Only valid on Linux")
def test_repl_eio(self):
# Use the pty-based approach to simulate EIO error
script_path = os.path.join(os.path.dirname(__file__), "eio_test_script.py")

proc = script_helper.spawn_python(
"-S", script_path,
stderr=subprocess.PIPE,
text=True
)

ready_line = proc.stdout.readline().strip()
if ready_line != "READY" or proc.poll() is not None:
self.fail("Child process failed to start properly")

os.kill(proc.pid, signal.SIGUSR1)
# sleep for pty to settle
_, err = proc.communicate(timeout=support.LONG_TIMEOUT)
self.assertEqual(
proc.returncode,
1,
f"Expected EIO/ENXIO error, got return code {proc.returncode}",
)
self.assertTrue(
(
"Got EIO:" in err
or "Got ENXIO:" in err
),
f"Expected EIO/ENXIO error message in stderr: {err}",
)
Loading