|
2 | 2 | import itertools |
3 | 3 | import os |
4 | 4 | import signal |
5 | | -import subprocess |
6 | 5 | import sys |
7 | 6 | import threading |
8 | 7 | import unittest |
9 | 8 | from functools import partial |
10 | | -from test import support |
11 | 9 | from test.support import os_helper, force_not_colorized_test_class |
12 | | -from test.support import script_helper, threading_helper |
| 10 | +from test.support import threading_helper |
13 | 11 |
|
14 | 12 | from unittest import TestCase |
15 | 13 | from unittest.mock import MagicMock, call, patch, ANY, Mock |
@@ -369,34 +367,3 @@ def test_eio_error_handling_in_restore(self, mock_tcgetattr, mock_tcsetattr): |
369 | 367 |
|
370 | 368 | # EIO error should be handled gracefully in restore() |
371 | 369 | console.restore() |
372 | | - |
373 | | - @unittest.skipUnless(sys.platform == "linux", "Only valid on Linux") |
374 | | - def test_repl_eio(self): |
375 | | - # Use the pty-based approach to simulate EIO error |
376 | | - script_path = os.path.join(os.path.dirname(__file__), "eio_test_script.py") |
377 | | - |
378 | | - proc = script_helper.spawn_python( |
379 | | - "-S", script_path, |
380 | | - stderr=subprocess.PIPE, |
381 | | - text=True |
382 | | - ) |
383 | | - |
384 | | - ready_line = proc.stdout.readline().strip() |
385 | | - if ready_line != "READY" or proc.poll() is not None: |
386 | | - self.fail("Child process failed to start properly") |
387 | | - |
388 | | - os.kill(proc.pid, signal.SIGUSR1) |
389 | | - # sleep for pty to settle |
390 | | - _, err = proc.communicate(timeout=support.LONG_TIMEOUT) |
391 | | - self.assertEqual( |
392 | | - proc.returncode, |
393 | | - 1, |
394 | | - f"Expected EIO/ENXIO error, got return code {proc.returncode}", |
395 | | - ) |
396 | | - self.assertTrue( |
397 | | - ( |
398 | | - "Got EIO:" in err |
399 | | - or "Got ENXIO:" in err |
400 | | - ), |
401 | | - f"Expected EIO/ENXIO error message in stderr: {err}", |
402 | | - ) |
0 commit comments