Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: b32a03430f3632493516b97e9b85b9fb9abb81b3 authored by Larry Hastings on 02 January 2017, 06:12:52 UTC
Version bump for 3.5.3rc1.
Tip revision: b32a034
test_eintr.py
import os
import signal
import subprocess
import sys
import unittest

from test import support
from test.support import script_helper


@unittest.skipUnless(os.name == "posix", "only supported on Unix")
class EINTRTests(unittest.TestCase):

    @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
    def test_all(self):
        # 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")

        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__":
    unittest.main()
back to top