88from distutils .version import LooseVersion as V
99from queue import Empty
1010
11- import nose .tools as nt
12-
1311import pytest
1412
1513import jupyter_client
@@ -295,7 +293,9 @@ def test_execute_silent():
295293 validate_message (status , 'status' , msg_id )
296294 assert status ['content' ]['execution_state' ] == 'idle'
297295
298- nt .assert_raises (Empty , KC .get_iopub_msg , timeout = 0.1 )
296+ with pytest .raises (Empty ):
297+ KC .get_iopub_msg (timeout = 0.1 )
298+
299299 count = reply ['execution_count' ]
300300
301301 msg_id , reply = execute (code = 'x=2' , silent = True )
@@ -305,7 +305,9 @@ def test_execute_silent():
305305 validate_message (status , 'status' , msg_id )
306306 assert status ['content' ]['execution_state' ] == 'idle'
307307
308- nt .assert_raises (Empty , KC .get_iopub_msg , timeout = 0.1 )
308+ with pytest .raises (Empty ):
309+ KC .get_iopub_msg (timeout = 0.1 )
310+
309311 count_2 = reply ['execution_count' ]
310312 assert count_2 == count
311313
@@ -389,11 +391,11 @@ def test_user_expressions():
389391
390392 msg_id , reply = execute (code = 'x=1' , user_expressions = dict (foo = 'x+1' ))
391393 user_expressions = reply ['user_expressions' ]
392- nt . assert_equal ( user_expressions , {'foo' : {
394+ assert user_expressions == {'foo' : {
393395 'status' : 'ok' ,
394396 'data' : {'text/plain' : '2' },
395397 'metadata' : {},
396- }})
398+ }}
397399
398400
399401def test_user_expressions_fail ():
0 commit comments