Skip to content

Commit c2eed66

Browse files
authored
Handle jupyter core warning (#58)
* handle jupyter core warning * remove jp_cleanup_subprocesses
1 parent ccf57c1 commit c2eed66

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ filterwarnings = [
6464
"module:make_current is deprecated:DeprecationWarning",
6565
"module:clear_current is deprecated:DeprecationWarning",
6666
"module:There is no current event loop:DeprecationWarning",
67+
# From juypter core
68+
"module:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
6769
]
6870

6971
[tool.mypy]

tests/test_auth.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ async def test_authorized_requests(
123123
io_loop,
124124
send_request,
125125
jp_serverapp,
126-
jp_cleanup_subprocesses,
127126
method,
128127
url,
129128
body,
@@ -156,5 +155,3 @@ async def test_authorized_requests(
156155
continue
157156
assert code in expected_codes
158157
break
159-
160-
await jp_cleanup_subprocesses()

tests/test_terminal.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def test_no_terminals(jp_fetch):
6161
assert len(data) == 0
6262

6363

64-
async def test_terminal_create(jp_fetch, jp_cleanup_subprocesses):
64+
async def test_terminal_create(jp_fetch):
6565
resp = await jp_fetch(
6666
"api",
6767
"terminals",
@@ -84,10 +84,9 @@ async def test_terminal_create(jp_fetch, jp_cleanup_subprocesses):
8484
del data[0]["last_activity"]
8585
del term["last_activity"]
8686
assert data[0] == term
87-
await jp_cleanup_subprocesses()
8887

8988

90-
async def test_terminal_create_with_kwargs(jp_fetch, terminal_path, jp_cleanup_subprocesses):
89+
async def test_terminal_create_with_kwargs(jp_fetch, terminal_path):
9190
resp_create = await jp_fetch(
9291
"api",
9392
"terminals",
@@ -110,12 +109,9 @@ async def test_terminal_create_with_kwargs(jp_fetch, terminal_path, jp_cleanup_s
110109
data = json.loads(resp_get.body.decode())
111110

112111
assert data["name"] == term_name
113-
await jp_cleanup_subprocesses()
114112

115113

116-
async def test_terminal_create_with_cwd(
117-
jp_fetch, jp_ws_fetch, terminal_path, jp_cleanup_subprocesses
118-
):
114+
async def test_terminal_create_with_cwd(jp_fetch, jp_ws_fetch, terminal_path):
119115
resp = await jp_fetch(
120116
"api",
121117
"terminals",
@@ -153,11 +149,10 @@ async def test_terminal_create_with_cwd(
153149
ws.close()
154150

155151
assert os.path.basename(terminal_path) in message_stdout
156-
await jp_cleanup_subprocesses()
157152

158153

159154
async def test_terminal_create_with_relative_cwd(
160-
jp_fetch, jp_ws_fetch, jp_root_dir, terminal_root_dir, jp_cleanup_subprocesses
155+
jp_fetch, jp_ws_fetch, jp_root_dir, terminal_root_dir
161156
):
162157
resp = await jp_fetch(
163158
"api",
@@ -197,10 +192,9 @@ async def test_terminal_create_with_relative_cwd(
197192

198193
expected = terminal_root_dir.name if sys.platform == "win32" else str(terminal_root_dir)
199194
assert expected in message_stdout
200-
await jp_cleanup_subprocesses()
201195

202196

203-
async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch, jp_cleanup_subprocesses):
197+
async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch):
204198
non_existing_path = "/tmp/path/to/nowhere"
205199
resp = await jp_fetch(
206200
"api",
@@ -239,7 +233,6 @@ async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch, jp_cleanup_su
239233
ws.close()
240234

241235
assert non_existing_path not in message_stdout
242-
await jp_cleanup_subprocesses()
243236

244237

245238
async def test_culling_config(jp_configurable_serverapp):
@@ -252,7 +245,7 @@ async def test_culling_config(jp_configurable_serverapp):
252245

253246

254247
@pytest.mark.skipif(os.name == "nt", reason="Not currently working on Windows")
255-
async def test_culling(jp_fetch, jp_cleanup_subprocesses):
248+
async def test_culling(jp_fetch):
256249
# POST request
257250
resp = await jp_fetch(
258251
"api",
@@ -282,4 +275,3 @@ async def test_culling(jp_fetch, jp_cleanup_subprocesses):
282275
await asyncio.sleep(1)
283276

284277
assert culled
285-
await jp_cleanup_subprocesses()

0 commit comments

Comments
 (0)