MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_communicate_eintr

Method test_communicate_eintr

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

Source from the content-addressed store, hash-verified

1686 @unittest.skipUnless(hasattr(os, 'getppid'),
1687 "Requires os.getppid")
1688 def test_communicate_eintr(self):
1689 # Issue #12493: communicate() should handle EINTR
1690 def handler(signum, frame):
1691 pass
1692 old_handler = signal.signal(signal.SIGUSR1, handler)
1693 self.addCleanup(signal.signal, signal.SIGUSR1, old_handler)
1694
1695 args = [sys.executable, "-c",
1696 'import os, signal;'
1697 'os.kill(os.getppid(), signal.SIGUSR1)']
1698 for stream in ('stdout', 'stderr'):
1699 kw = {stream: subprocess.PIPE}
1700 with subprocess.Popen(args, **kw) as process:
1701 # communicate() will be interrupted by SIGUSR1
1702 process.communicate()
1703
1704
1705 # 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