@@ -151,7 +151,7 @@ def assert_session_equality(actual, expected):
151
151
assert_kernel_equality (actual ["kernel" ], expected ["kernel" ])
152
152
153
153
154
- async def test_create (session_client , jp_base_url ):
154
+ async def test_create (session_client , jp_base_url , jp_cleanup_subprocesses ):
155
155
# Make sure no sessions exist.
156
156
resp = await session_client .list ()
157
157
sessions = j (resp )
@@ -182,28 +182,31 @@ async def test_create(session_client, jp_base_url):
182
182
183
183
# Need to find a better solution to this.
184
184
await session_client .cleanup ()
185
+ await jp_cleanup_subprocesses ()
185
186
186
187
187
- async def test_create_file_session (session_client ):
188
+ async def test_create_file_session (session_client , jp_cleanup_subprocesses ):
188
189
resp = await session_client .create ("foo/nb1.py" , type = "file" )
189
190
assert resp .code == 201
190
191
newsession = j (resp )
191
192
assert newsession ["path" ] == "foo/nb1.py"
192
193
assert newsession ["type" ] == "file"
193
194
await session_client .cleanup ()
195
+ await jp_cleanup_subprocesses ()
194
196
195
197
196
- async def test_create_console_session (session_client ):
198
+ async def test_create_console_session (session_client , jp_cleanup_subprocesses ):
197
199
resp = await session_client .create ("foo/abc123" , type = "console" )
198
200
assert resp .code == 201
199
201
newsession = j (resp )
200
202
assert newsession ["path" ] == "foo/abc123"
201
203
assert newsession ["type" ] == "console"
202
204
# Need to find a better solution to this.
203
205
await session_client .cleanup ()
206
+ await jp_cleanup_subprocesses ()
204
207
205
208
206
- async def test_create_deprecated (session_client ):
209
+ async def test_create_deprecated (session_client , jp_cleanup_subprocesses ):
207
210
resp = await session_client .create_deprecated ("foo/nb1.ipynb" )
208
211
assert resp .code == 201
209
212
newsession = j (resp )
@@ -212,9 +215,12 @@ async def test_create_deprecated(session_client):
212
215
assert newsession ["notebook" ]["path" ] == "foo/nb1.ipynb"
213
216
# Need to find a better solution to this.
214
217
await session_client .cleanup ()
218
+ await jp_cleanup_subprocesses ()
215
219
216
220
217
- async def test_create_with_kernel_id (session_client , jp_fetch , jp_base_url ):
221
+ async def test_create_with_kernel_id (
222
+ session_client , jp_fetch , jp_base_url , jp_cleanup_subprocesses
223
+ ):
218
224
# create a new kernel
219
225
resp = await jp_fetch ("api/kernels" , method = "POST" , allow_nonstandard_methods = True )
220
226
kernel = j (resp )
@@ -241,9 +247,10 @@ async def test_create_with_kernel_id(session_client, jp_fetch, jp_base_url):
241
247
assert_session_equality (got , new_session )
242
248
# Need to find a better solution to this.
243
249
await session_client .cleanup ()
250
+ await jp_cleanup_subprocesses ()
244
251
245
252
246
- async def test_delete (session_client ):
253
+ async def test_delete (session_client , jp_cleanup_subprocesses ):
247
254
resp = await session_client .create ("foo/nb1.ipynb" )
248
255
newsession = j (resp )
249
256
sid = newsession ["id" ]
@@ -260,9 +267,10 @@ async def test_delete(session_client):
260
267
assert expected_http_error (e , 404 )
261
268
# Need to find a better solution to this.
262
269
await session_client .cleanup ()
270
+ await jp_cleanup_subprocesses ()
263
271
264
272
265
- async def test_modify_path (session_client ):
273
+ async def test_modify_path (session_client , jp_cleanup_subprocesses ):
266
274
resp = await session_client .create ("foo/nb1.ipynb" )
267
275
newsession = j (resp )
268
276
sid = newsession ["id" ]
@@ -273,9 +281,10 @@ async def test_modify_path(session_client):
273
281
assert changed ["path" ] == "nb2.ipynb"
274
282
# Need to find a better solution to this.
275
283
await session_client .cleanup ()
284
+ await jp_cleanup_subprocesses ()
276
285
277
286
278
- async def test_modify_path_deprecated (session_client ):
287
+ async def test_modify_path_deprecated (session_client , jp_cleanup_subprocesses ):
279
288
resp = await session_client .create ("foo/nb1.ipynb" )
280
289
newsession = j (resp )
281
290
sid = newsession ["id" ]
@@ -286,9 +295,10 @@ async def test_modify_path_deprecated(session_client):
286
295
assert changed ["notebook" ]["path" ] == "nb2.ipynb"
287
296
# Need to find a better solution to this.
288
297
await session_client .cleanup ()
298
+ await jp_cleanup_subprocesses ()
289
299
290
300
291
- async def test_modify_type (session_client ):
301
+ async def test_modify_type (session_client , jp_cleanup_subprocesses ):
292
302
resp = await session_client .create ("foo/nb1.ipynb" )
293
303
newsession = j (resp )
294
304
sid = newsession ["id" ]
@@ -299,9 +309,10 @@ async def test_modify_type(session_client):
299
309
assert changed ["type" ] == "console"
300
310
# Need to find a better solution to this.
301
311
await session_client .cleanup ()
312
+ await jp_cleanup_subprocesses ()
302
313
303
314
304
- async def test_modify_kernel_name (session_client , jp_fetch ):
315
+ async def test_modify_kernel_name (session_client , jp_fetch , jp_cleanup_subprocesses ):
305
316
resp = await session_client .create ("foo/nb1.ipynb" )
306
317
before = j (resp )
307
318
sid = before ["id" ]
@@ -321,9 +332,10 @@ async def test_modify_kernel_name(session_client, jp_fetch):
321
332
assert kernel_list == [after ["kernel" ]]
322
333
# Need to find a better solution to this.
323
334
await session_client .cleanup ()
335
+ await jp_cleanup_subprocesses ()
324
336
325
337
326
- async def test_modify_kernel_id (session_client , jp_fetch ):
338
+ async def test_modify_kernel_id (session_client , jp_fetch , jp_cleanup_subprocesses ):
327
339
resp = await session_client .create ("foo/nb1.ipynb" )
328
340
before = j (resp )
329
341
sid = before ["id" ]
@@ -351,9 +363,12 @@ async def test_modify_kernel_id(session_client, jp_fetch):
351
363
352
364
# Need to find a better solution to this.
353
365
await session_client .cleanup ()
366
+ await jp_cleanup_subprocesses ()
354
367
355
368
356
- async def test_restart_kernel (session_client , jp_base_url , jp_fetch , jp_ws_fetch ):
369
+ async def test_restart_kernel (
370
+ session_client , jp_base_url , jp_fetch , jp_ws_fetch , jp_cleanup_subprocesses
371
+ ):
357
372
358
373
# Create a session.
359
374
resp = await session_client .create ("foo/nb1.ipynb" )
@@ -412,3 +427,4 @@ async def test_restart_kernel(session_client, jp_base_url, jp_fetch, jp_ws_fetch
412
427
413
428
# Need to find a better solution to this.
414
429
await session_client .cleanup ()
430
+ await jp_cleanup_subprocesses ()
0 commit comments