Skip to content

Commit 3e28cfd

Browse files
committed
Feedback: improve test coverage.
1 parent 8d9b8c6 commit 3e28cfd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

notebook/tests/test_notebookapp_integration.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_shutdown_sock_server_integration():
1717
encoded_sock_path = urlencode_unix_socket_path(sock)
1818

1919
p = subprocess.Popen(
20-
['jupyter-notebook', '--no-browser', '--sock=%s' % sock],
20+
['jupyter-notebook', '--sock=%s' % sock],
2121
stdout=subprocess.PIPE, stderr=subprocess.PIPE
2222
)
2323

@@ -33,6 +33,15 @@ def test_shutdown_sock_server_integration():
3333
# Ensure default umask is properly applied.
3434
assert stat.S_IMODE(os.lstat(sock).st_mode) == 0o600
3535

36+
try:
37+
subprocess.check_output(['jupyter-notebook', 'stop'], stderr=subprocess.STDOUT)
38+
except subprocess.CalledProcessError as e:
39+
assert 'There is currently no server running on' in e.output.decode()
40+
else:
41+
raise AssertionError('expected stop command to fail due to target mis-match')
42+
43+
assert encoded_sock_path.encode() in subprocess.check_output(['jupyter-notebook', 'list'])
44+
3645
subprocess.check_output(['jupyter-notebook', 'stop', sock])
3746

3847
assert encoded_sock_path.encode() not in subprocess.check_output(['jupyter-notebook', 'list'])
@@ -54,7 +63,7 @@ def _ensure_stopped(check_msg='There are no running servers'):
5463

5564

5665
@skip_win32
57-
def test_stop_multi():
66+
def test_stop_multi_integration():
5867
"""Tests lifecycle behavior for mixed-mode server types w/ default ports.
5968
6069
Mostly suitable for local dev testing due to reliance on default port binding.
@@ -72,7 +81,7 @@ def test_stop_multi():
7281
# Unix socket.
7382
sock = UNIXSocketNotebookTestBase.sock
7483
p2 = subprocess.Popen(
75-
['jupyter-notebook', '--no-browser', '--sock=%s' % sock]
84+
['jupyter-notebook', '--sock=%s' % sock]
7685
)
7786

7887
# Specified port

0 commit comments

Comments
 (0)