Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(83573)

Side by Side Diff: Lib/test/test_signal.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_shutil.py ('k') | Lib/test/test_site.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import unittest 1 import unittest
2 from test import support 2 from test import support
3 from contextlib import closing 3 from contextlib import closing
4 import enum 4 import enum
5 import gc 5 import gc
6 import pickle 6 import pickle
7 import select 7 import select
8 import signal 8 import signal
9 import socket 9 import socket
10 import struct 10 import struct
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 self.fail("Some other exception woke us from pause: %s" % 151 self.fail("Some other exception woke us from pause: %s" %
152 traceback.format_exc()) 152 traceback.format_exc())
153 else: 153 else:
154 self.fail("pause returned of its own accord, and the signal" 154 self.fail("pause returned of its own accord, and the signal"
155 " didn't arrive after another second.") 155 " didn't arrive after another second.")
156 156
157 # Issue 3864, unknown if this affects earlier versions of freebsd also 157 # Issue 3864, unknown if this affects earlier versions of freebsd also
158 @unittest.skipIf(sys.platform=='freebsd6', 158 @unittest.skipIf(sys.platform=='freebsd6',
159 'inter process signals not reliable (do not mix well with threading) ' 159 'inter process signals not reliable (do not mix well with threading) '
160 'on freebsd6') 160 'on freebsd6')
161 @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess .Popen()")
161 def test_main(self): 162 def test_main(self):
162 # This function spawns a child process to insulate the main 163 # This function spawns a child process to insulate the main
163 # test-running process from all the signals. It then 164 # test-running process from all the signals. It then
164 # communicates with that child process over a pipe and 165 # communicates with that child process over a pipe and
165 # re-raises information about any exceptions the child 166 # re-raises information about any exceptions the child
166 # raises. The real work happens in self.run_test(). 167 # raises. The real work happens in self.run_test().
167 os_done_r, os_done_w = os.pipe() 168 os_done_r, os_done_w = os.pipe()
168 with closing(os.fdopen(os_done_r, 'rb')) as done_r, \ 169 with closing(os.fdopen(os_done_r, 'rb')) as done_r, \
169 closing(os.fdopen(os_done_w, 'wb')) as done_w: 170 closing(os.fdopen(os_done_w, 'wb')) as done_w:
170 child = os.fork() 171 child = os.fork()
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 if exitcode != 3: 1098 if exitcode != 3:
1098 raise Exception("Child error (exit code %s): %s" % 1099 raise Exception("Child error (exit code %s): %s" %
1099 (exitcode, stdout)) 1100 (exitcode, stdout))
1100 1101
1101 1102
1102 def tearDownModule(): 1103 def tearDownModule():
1103 support.reap_children() 1104 support.reap_children()
1104 1105
1105 if __name__ == "__main__": 1106 if __name__ == "__main__":
1106 unittest.main() 1107 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_shutil.py ('k') | Lib/test/test_site.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+