Skip to content

Commit a2c6330

Browse files
committed
-
1 parent 73ae49d commit a2c6330

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tests/test_io.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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

tests/test_kernel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_simple_print():
6262
def 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():
9494
def 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():
132132
def 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

tests/test_zmq_shell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)