1-
21import os
32import getpass
4- import pathlib
53import pytest
64import logging
7-
85from unittest .mock import patch
96
10-
117from traitlets import TraitError
128from traitlets .tests .utils import check_help_all_output
13-
149from jupyter_core .application import NoStart
1510
16-
1711from jupyter_server .serverapp import (
18- ServerApp ,
12+ ServerApp ,
1913 list_running_servers ,
2014 JupyterPasswordApp ,
2115 JupyterServerStopApp
@@ -35,12 +29,12 @@ def test_server_info_file(tmp_path, configurable_serverapp):
3529 servers = list (list_running_servers (app .runtime_dir ))
3630
3731 assert len (servers ) == 1
38- sinfo = servers [0 ]
39-
32+ sinfo = servers [0 ]
33+
4034 assert sinfo ['port' ] == app .port
4135 assert sinfo ['url' ] == app .connection_url
4236 assert sinfo ['version' ] == app .version
43-
37+
4438 app .remove_server_info_file ()
4539
4640 assert list (list_running_servers (app .runtime_dir )) == []
@@ -62,7 +56,7 @@ def test_root_dir(tmp_path, configurable_serverapp):
6256)
6357def invalid_root_dir (tmp_path , request ):
6458 path = tmp_path .joinpath (* request .param )
65- # If the path is a file, create it.
59+ # If the path is a file, create it.
6660 if os .path .splitext (str (path ))[1 ] != '' :
6761 path .write_text ('' )
6862 return str (path )
@@ -90,10 +84,10 @@ def valid_root_dir(tmp_path, request):
9084def test_valid_root_dir (valid_root_dir , configurable_serverapp ):
9185 app = configurable_serverapp (root_dir = valid_root_dir )
9286 root_dir = valid_root_dir
93- # If nested path, the last slash should
87+ # If nested path, the last slash should
9488 # be stripped by the root_dir trait.
9589 if root_dir != '/' :
96- root_dir = valid_root_dir .rstrip ('/' )
90+ root_dir = valid_root_dir .rstrip ('/' )
9791 assert app .root_dir == root_dir
9892
9993
0 commit comments