File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -207,18 +207,24 @@ async def kernel(anyio_backend):
207207 async with create_task_group () as tg :
208208 kernel = MockKernel ()
209209 tg .start_soon (kernel .start )
210- yield kernel
211- kernel .destroy ()
210+ try :
211+ yield kernel
212+ finally :
213+ kernel .destroy ()
212214
213215
214216@pytest .fixture ()
215217async def ipkernel (anyio_backend ):
216218 async with create_task_group () as tg :
217219 kernel = MockIPyKernel ()
218220 tg .start_soon (kernel .start )
219- yield kernel
220- kernel .destroy ()
221- ZMQInteractiveShell .clear_instance ()
221+ try :
222+ yield kernel
223+ finally :
224+ kernel .destroy ()
225+ kernel .shell .history_manager = None
226+ kernel .shell .configurables = []
227+ ZMQInteractiveShell .clear_instance ()
222228
223229
224230@pytest .fixture ()
You can’t perform that action at this time.
0 commit comments