3434def _check_master (kc , expected = True , stream = "stdout" ):
3535 execute (kc = kc , code = "import sys" )
3636 flush_channels (kc )
37- msg_id , content = execute (kc = kc , code = "print(sys.%s._is_master_process())" % stream )
38- stdout , stderr = assemble_output (kc .get_iopub_msg )
37+ _msg_id , _content = execute (kc = kc , code = "print(sys.%s._is_master_process())" % stream )
38+ stdout , _stderr = assemble_output (kc .get_iopub_msg )
3939 assert stdout .strip () == repr (expected )
4040
4141
@@ -51,7 +51,7 @@ def _check_status(content):
5151def test_simple_print ():
5252 """simple print statement in kernel"""
5353 with kernel () as kc :
54- msg_id , content = execute (kc = kc , code = "print('hi')" )
54+ _msg_id , _content = execute (kc = kc , code = "print('hi')" )
5555 stdout , stderr = assemble_output (kc .get_iopub_msg )
5656 assert stdout == "hi\n "
5757 assert stderr == ""
@@ -251,7 +251,7 @@ def test_capture_fd():
251251 """simple print statement in kernel"""
252252 with kernel () as kc :
253253 iopub = kc .iopub_channel
254- msg_id , content = execute (kc = kc , code = "import os; os.system('echo capsys')" )
254+ _msg_id , _content = execute (kc = kc , code = "import os; os.system('echo capsys')" )
255255 stdout , stderr = assemble_output (iopub )
256256 assert stdout == "capsys\n "
257257 assert stderr == ""
@@ -262,7 +262,7 @@ def test_capture_fd():
262262def test_subprocess_peek_at_stream_fileno ():
263263 with kernel () as kc :
264264 iopub = kc .iopub_channel
265- msg_id , content = execute (
265+ _msg_id , _content = execute (
266266 kc = kc ,
267267 code = "import subprocess, sys; subprocess.run(['python', '-c', 'import os; os.system(\" echo CAP1\" ); print(\" CAP2\" )'], stderr=sys.stderr)" ,
268268 )
@@ -275,7 +275,7 @@ def test_subprocess_peek_at_stream_fileno():
275275def test_sys_path ():
276276 """test that sys.path doesn't get messed up by default"""
277277 with kernel () as kc :
278- msg_id , content = execute (kc = kc , code = "import sys; print(repr(sys.path))" )
278+ _msg_id , _content = execute (kc = kc , code = "import sys; print(repr(sys.path))" )
279279 stdout , stderr = assemble_output (kc .get_iopub_msg )
280280 # for error-output on failure
281281 sys .stderr .write (stderr )
@@ -288,7 +288,7 @@ def test_sys_path_profile_dir():
288288 """test that sys.path doesn't get messed up when `--profile-dir` is specified"""
289289
290290 with new_kernel (["--profile-dir" , locate_profile ("default" )]) as kc :
291- msg_id , content = execute (kc = kc , code = "import sys; print(repr(sys.path))" )
291+ _msg_id , _content = execute (kc = kc , code = "import sys; print(repr(sys.path))" )
292292 stdout , stderr = assemble_output (kc .get_iopub_msg )
293293 # for error-output on failure
294294 sys .stderr .write (stderr )
@@ -323,7 +323,7 @@ def test_subprocess_print():
323323 ]
324324 )
325325
326- msg_id , content = execute (kc = kc , code = code )
326+ _msg_id , _content = execute (kc = kc , code = code )
327327 stdout , stderr = assemble_output (kc .get_iopub_msg )
328328 assert stdout .count ("hello" ) == np , stdout
329329 for n in range (np ):
@@ -347,7 +347,7 @@ def test_subprocess_noprint():
347347 ]
348348 )
349349
350- msg_id , content = execute (kc = kc , code = code )
350+ _msg_id , _content = execute (kc = kc , code = code )
351351 stdout , stderr = assemble_output (kc .get_iopub_msg )
352352 assert stdout == ""
353353 assert stderr == ""
@@ -373,7 +373,7 @@ def test_subprocess_error():
373373 ]
374374 )
375375
376- msg_id , content = execute (kc = kc , code = code )
376+ _msg_id , _content = execute (kc = kc , code = code )
377377 stdout , stderr = assemble_output (kc .get_iopub_msg )
378378 assert stdout == ""
379379 assert "ValueError" in stderr
@@ -400,7 +400,7 @@ def test_raw_input():
400400 kc .input (text )
401401 reply = kc .get_shell_msg (timeout = TIMEOUT )
402402 assert reply ["content" ]["status" ] == "ok"
403- stdout , stderr = assemble_output (kc .get_iopub_msg )
403+ stdout , _stderr = assemble_output (kc .get_iopub_msg )
404404 assert stdout == text + "\n "
405405
406406
@@ -555,7 +555,7 @@ def test_unc_paths():
555555 kc .execute (code = "ls" )
556556 reply = kc .get_shell_msg (timeout = TIMEOUT )
557557 assert reply ["content" ]["status" ] == "ok"
558- out , err = assemble_output (kc .get_iopub_msg )
558+ out , _err = assemble_output (kc .get_iopub_msg )
559559 assert "unc.txt" in out
560560
561561 kc .execute (code = "cd" )
@@ -774,7 +774,7 @@ def test_shutdown_subprocesses():
774774 """Kernel exits after polite shutdown_request"""
775775 with new_kernel () as kc :
776776 km = kc .parent
777- msg_id , reply = execute (
777+ _msg_id , reply = execute (
778778 f"from { __name__ } import _start_children\n _start_children()" ,
779779 kc = kc ,
780780 user_expressions = {
0 commit comments