1import os
2import signal
3import unittest
4
5from test import support
6from test.support import script_helper
7
8
9@unittest.skipUnless(os.name == "posix", "only supported on Unix")
10class EINTRTests(unittest.TestCase):
11
12    @unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()")
13    def test_all(self):
14        # Run the tester in a sub-process, to make sure there is only one
15        # thread (for reliable signal delivery).
16        tester = support.findfile("eintr_tester.py", subdir="eintrdata")
17        # use -u to try to get the full output if the test hangs or crash
18        script_helper.assert_python_ok("-u", tester)
19
20
21if __name__ == "__main__":
22    unittest.main()
23