Skip to content

Commit

Permalink
Merge pull request jupyter-server#331 from farisachugthai/imports
Browse files Browse the repository at this point in the history
Remove a few more unused imports
  • Loading branch information
kevin-bates authored Nov 5, 2020
2 parents 75f12d2 + bc3e42b commit 68ee955
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
2 changes: 0 additions & 2 deletions tests/test_config_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import json
import os
import shutil
import tempfile

from jupyter_server.config_manager import BaseJSONConfigManager

Expand Down
2 changes: 1 addition & 1 deletion tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ async def test_old_files_redirect(fetch, serverapp, root_dir):
# r = self.request('GET', 'files/test.txt?download=1')
# disposition = r.headers.get('Content-Disposition', '')
# self.assertIn('attachment', disposition)
# self.assertIn("filename*=utf-8''test.txt", disposition)
# self.assertIn("filename*=utf-8''test.txt", disposition)
20 changes: 7 additions & 13 deletions tests/test_serverapp.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@

import os
import getpass
import pathlib
import pytest
import logging

from unittest.mock import patch


from traitlets import TraitError
from traitlets.tests.utils import check_help_all_output

from jupyter_core.application import NoStart


from jupyter_server.serverapp import (
ServerApp,
ServerApp,
list_running_servers,
JupyterPasswordApp,
JupyterServerStopApp
Expand All @@ -35,12 +29,12 @@ def test_server_info_file(tmp_path, configurable_serverapp):
servers = list(list_running_servers(app.runtime_dir))

assert len(servers) == 1
sinfo = servers[0]
sinfo = servers[0]

assert sinfo['port'] == app.port
assert sinfo['url'] == app.connection_url
assert sinfo['version'] == app.version

app.remove_server_info_file()

assert list(list_running_servers(app.runtime_dir)) == []
Expand All @@ -62,7 +56,7 @@ def test_root_dir(tmp_path, configurable_serverapp):
)
def invalid_root_dir(tmp_path, request):
path = tmp_path.joinpath(*request.param)
# If the path is a file, create it.
# If the path is a file, create it.
if os.path.splitext(str(path))[1] != '':
path.write_text('')
return str(path)
Expand Down Expand Up @@ -90,10 +84,10 @@ def valid_root_dir(tmp_path, request):
def test_valid_root_dir(valid_root_dir, configurable_serverapp):
app = configurable_serverapp(root_dir=valid_root_dir)
root_dir = valid_root_dir
# If nested path, the last slash should
# If nested path, the last slash should
# be stripped by the root_dir trait.
if root_dir != '/':
root_dir = valid_root_dir.rstrip('/')
root_dir = valid_root_dir.rstrip('/')
assert app.root_dir == root_dir


Expand Down

0 comments on commit 68ee955

Please sign in to comment.