Skip to content

Commit da0fef5

Browse files
committed
updates from review
1 parent a0640b3 commit da0fef5

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

jupyter_server/serverapp.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,16 @@
4141
from jupyter_server.transutils import trans, _
4242
from jupyter_server.utils import secure_write, run_sync
4343

44-
# check for tornado 3.1.0
44+
# the minimum viable tornado version: needs to be kept in sync with setup.py
45+
MIN_TORNADO = (6, 1)
46+
4547
try:
4648
import tornado
47-
except ImportError as e:
48-
raise ImportError(_("The Jupyter Server requires tornado >= 4.0")) from e
49-
try:
50-
version_info = tornado.version_info
51-
except AttributeError as e:
52-
raise ImportError(_("The Jupyter Server requires tornado >= 4.0, but you have < 1.1.0")) from e
53-
if version_info < (4,0):
54-
raise ImportError(_("The Jupyter Server requires tornado >= 4.0, but you have %s") % tornado.version)
49+
assert tornado.version_info >= MIN_TORNADO
50+
except (ImportError, AttributeError, AssertionError) as e: # pragma: no cover
51+
raise ImportError(
52+
_("The Jupyter Server requires tornado >=%s", ".".join(MIN_TORNADO))
53+
) from e
5554

5655
from tornado import httpserver
5756
from tornado import ioloop

tests/conftest.py

Whitespace-only changes.

tests/test_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def fetch_expect_200(jp_fetch, *path_parts):
2828

2929
async def fetch_expect_404(jp_fetch, *path_parts):
3030
with pytest.raises(tornado.httpclient.HTTPClientError) as e:
31-
r = await jp_fetch('files', *path_parts, method='GET')
31+
await jp_fetch('files', *path_parts, method='GET')
3232
assert expected_http_error(e, 404), [path_parts, e]
3333

3434

0 commit comments

Comments
 (0)