Skip to content

Commit 960fdb6

Browse files
committed
http://b/277579939 force close jupyter in tests
1 parent 717cb18 commit 960fdb6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tests/test_jupyterlab_lsp.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import unittest
33

44
from jupyter_server.serverapp import ServerApp
5-
import subprocess
65

76
# Adapted from:
87
# https://github.com/jupyter-lsp/jupyterlab-lsp/blob/ce76fab170feea506faf9ef47e4bd6a468c24313/python_packages/jupyter_lsp/jupyter_lsp/tests/test_extension.py
@@ -29,9 +28,4 @@ def test_serverextension(self):
2928
found_lsp = True
3029

3130
self.assertTrue(found_lsp, "didn't install the /lsp/ route")
32-
app.stop()
33-
34-
strpid=subprocess.Popen("ps -ef | grep jupyter | grep 9999 | awk '{print $2}' | head -n 1", shell=True, stdout=subprocess.PIPE).stdout.read().decode("utf-8").strip()
35-
if strpid != "":
36-
pid=int(strpid)
37-
os.kill(pid, 9)
31+
os.kill(app.server_info()['pid'], 9)

0 commit comments

Comments
 (0)