##// END OF EJS Templates
resolve rebase conflict...
MinRK -
Show More
@@ -50,7 +50,7 b' def flush_channels(km=None):'
50 50 if km is None:
51 51 km = KM
52 52 """flush any messages waiting on the queue"""
53 for channel in (KM.shell_channel, KM.iopub_channel):
53 for channel in (km.shell_channel, km.iopub_channel):
54 54 while True:
55 55 try:
56 56 msg = channel.get_msg(block=True, timeout=0.1)
@@ -108,14 +108,14 b' def _check_mp_mode(km, expected=False, stream="stdout"):'
108 108 execute(km=km, code="import sys")
109 109 flush_channels(km)
110 110 msg_id, content = execute(km=km, code="print (sys.%s._check_mp_mode())" % stream)
111 stdout, stderr = assemble_output(km.sub_channel)
111 stdout, stderr = assemble_output(km.iopub_channel)
112 112 nt.assert_equal(eval(stdout.strip()), expected)
113 113
114 114
115 115 def test_simple_print():
116 116 """simple print statement in kernel"""
117 117 with new_kernel() as km:
118 iopub = km.sub_channel
118 iopub = km.iopub_channel
119 119 msg_id, content = execute(km=km, code="print ('hi')")
120 120 stdout, stderr = assemble_output(iopub)
121 121 nt.assert_equal(stdout, 'hi\n')
@@ -127,7 +127,7 b' def test_simple_print():'
127 127 def test_subprocess_print():
128 128 """printing from forked mp.Process"""
129 129 with new_kernel() as km:
130 iopub = km.sub_channel
130 iopub = km.iopub_channel
131 131
132 132 _check_mp_mode(km, expected=False)
133 133 flush_channels(km)
@@ -158,7 +158,7 b' def test_subprocess_print():'
158 158 def test_subprocess_noprint():
159 159 """mp.Process without print doesn't trigger iostream mp_mode"""
160 160 with new_kernel() as km:
161 iopub = km.sub_channel
161 iopub = km.iopub_channel
162 162
163 163 np = 5
164 164 code = '\n'.join([
@@ -182,7 +182,7 b' def test_subprocess_noprint():'
182 182 def test_subprocess_error():
183 183 """error in mp.Process doesn't crash"""
184 184 with new_kernel() as km:
185 iopub = km.sub_channel
185 iopub = km.iopub_channel
186 186
187 187 code = '\n'.join([
188 188 "import multiprocessing as mp",
General Comments 0
You need to be logged in to leave comments. Login now