Skip to content

Commit 41f39dc

Browse files
committed
-
1 parent 9aaf90a commit 41f39dc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ipykernel/tests/test_kernel.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def _check_status(content):
4444
def test_simple_print():
4545
"""simple print statement in kernel"""
4646
with kernel() as kc:
47+
iopub = kc.iopub_channel
4748
msg_id, content = execute(kc=kc, code="print ('hi')")
4849
stdout, stderr = assemble_output(kc.get_iopub_msg)
4950
assert stdout == 'hi\n'
@@ -84,6 +85,8 @@ def test_sys_path_profile_dir():
8485
def test_subprocess_print():
8586
"""printing from forked mp.Process"""
8687
with new_kernel() as kc:
88+
iopub = kc.iopub_channel
89+
8790
_check_master(kc, expected=True)
8891
flush_channels(kc)
8992
np = 5
@@ -110,6 +113,8 @@ def test_subprocess_print():
110113
def test_subprocess_noprint():
111114
"""mp.Process without print doesn't trigger iostream mp_mode"""
112115
with kernel() as kc:
116+
iopub = kc.iopub_channel
117+
113118
np = 5
114119
code = '\n'.join([
115120
"import multiprocessing as mp",
@@ -135,6 +140,8 @@ def test_subprocess_noprint():
135140
def test_subprocess_error():
136141
"""error in mp.Process doesn't crash"""
137142
with new_kernel() as kc:
143+
iopub = kc.iopub_channel
144+
138145
code = '\n'.join([
139146
"import multiprocessing as mp",
140147
"p = mp.Process(target=int, args=('hi',))",
@@ -155,6 +162,8 @@ def test_subprocess_error():
155162
def test_raw_input():
156163
"""test input"""
157164
with kernel() as kc:
165+
iopub = kc.iopub_channel
166+
158167
input_f = "input"
159168
theprompt = "prompt> "
160169
code = 'print({input_f}("{theprompt}"))'.format(**locals())
@@ -304,6 +313,8 @@ def test_unc_paths():
304313
file_path = os.path.splitdrive(os.path.dirname(drive_file_path))[1]
305314
unc_file_path = os.path.join(unc_root, file_path[1:])
306315

316+
iopub = kc.iopub_channel
317+
307318
kc.execute("cd {0:s}".format(unc_file_path))
308319
reply = kc.get_shell_msg(block=True, timeout=TIMEOUT)
309320
assert reply['content']['status'] == 'ok'

0 commit comments

Comments
 (0)