Commit 4b352171 authored by Victor Stinner's avatar Victor Stinner

Issue #25122: sync test_eintr with Python 3.6

* test_eintr: support verbose mode, don't redirect eintr_tester output into
  a pipe
* eintr_tester: replace os.fork() with subprocess to have a cleaner child
  process (ex: don't inherit setitimer())
* eintr_tester: kill the process if the unit test fails
* test_open/test_os_open(): write support.PIPE_MAX_SIZE bytes instead of
  support.PIPE_MAX_SIZE*3 bytes
parent cd6e6943
This diff is collapsed.
import os
import signal
import subprocess
import sys
import unittest
from test import support
......@@ -14,7 +16,14 @@ class EINTRTests(unittest.TestCase):
# Run the tester in a sub-process, to make sure there is only one
# thread (for reliable signal delivery).
tester = support.findfile("eintr_tester.py", subdir="eintrdata")
script_helper.assert_python_ok(tester)
if support.verbose:
args = [sys.executable, tester]
with subprocess.Popen(args) as proc:
exitcode = proc.wait()
self.assertEqual(exitcode, 0)
else:
script_helper.assert_python_ok(tester)
if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment