File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,12 @@ async def iopub_thread(ctx):
3737 thread = IOPubThread (pub )
3838 thread .start ()
3939
40- yield thread
41-
42- await pub .stop ()
43- thread .stop ()
44- thread .close ()
40+ try :
41+ yield thread
42+ finally :
43+ await pub .stop ()
44+ thread .stop ()
45+ thread .close ()
4546 except BaseException :
4647 pass
4748
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def test_simple_print():
6262def test_print_to_correct_cell_from_thread ():
6363 """should print to the cell that spawned the thread, not a subsequently run cell"""
6464 iterations = 5
65- interval = 1
65+ interval = 0.25
6666 code = f"""\
6767 from threading import Thread
6868 from time import sleep
@@ -94,7 +94,7 @@ def thread_target():
9494def test_print_to_correct_cell_from_child_thread ():
9595 """should print to the cell that spawned the thread, not a subsequently run cell"""
9696 iterations = 5
97- interval = 1
97+ interval = 0.25
9898 code = f"""\
9999 from threading import Thread
100100 from time import sleep
@@ -132,7 +132,7 @@ def parent_target():
132132def test_print_to_correct_cell_from_asyncio ():
133133 """should print to the cell that scheduled the task, not a subsequently run cell"""
134134 iterations = 5
135- interval = 1
135+ interval = 0.25
136136 code = f"""\
137137 import asyncio
138138
Original file line number Diff line number Diff line change @@ -229,10 +229,9 @@ def test_magics(tmp_path):
229229 if os .name == "posix" :
230230 magics .man ("ls" )
231231 magics .autosave ("10" )
232-
232+ finally :
233233 socket .close ()
234234 context .destroy ()
235- finally :
236235 shell .configurables = []
237236 InteractiveShell .clear_instance ()
238237
You can’t perform that action at this time.
0 commit comments