MCPcopy Index your code
hub / github.com/python/cpython / test_communicate_eintr

Method test_communicate_eintr

Lib/test/test_subprocess.py:1690–1704  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1688 @unittest.skipUnless(hasattr(os, 'getppid'),
1689 "Requires os.getppid")
1690 def test_communicate_eintr(self):
1691 # Issue #12493: communicate() should handle EINTR
1692 def handler(signum, frame):
1693 pass
1694 old_handler = signal.signal(signal.SIGUSR1, handler)
1695 self.addCleanup(signal.signal, signal.SIGUSR1, old_handler)
1696
1697 args = [sys.executable, "-c",
1698 'import os, signal;'
1699 'os.kill(os.getppid(), signal.SIGUSR1)']
1700 for stream in ('stdout', 'stderr'):
1701 kw = {stream: subprocess.PIPE}
1702 with subprocess.Popen(args, **kw) as process:
1703 # communicate() will be interrupted by SIGUSR1
1704 process.communicate()
1705
1706
1707 # This test is Linux-ish specific for simplicity to at least have

Callers

nothing calls this directly

Calls 2

addCleanupMethod · 0.80
communicateMethod · 0.45

Tested by

no test coverage detected