Skip to content

Commit

Permalink
clean up typing
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 9, 2023
1 parent 448c310 commit 30604b8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jupyter_server/_tz.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def dst(self, d):
return ZERO


UTC = tzUTC()
UTC = tzUTC() # type:ignore[abstract]


def utc_aware(unaware):
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/nbconvert/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_exporter(format, **kwargs):
"""get an exporter, raising appropriate errors"""
# if this fails, will raise 500
try:
from nbconvert.exporters.base import get_exporter # type:ignore[assignment]
from nbconvert.exporters.base import get_exporter
except ImportError as e:
raise web.HTTPError(500, "Could not import nbconvert: %s" % e) from e

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ nowarn = "test -W default {args}"

[tool.hatch.envs.typing]
features = ["test"]
dependencies = [ "mypy>=0.990" ]
dependencies = [ "mypy>=1.5.1" ]
[tool.hatch.envs.typing.scripts]
test = "mypy --install-types --non-interactive {args:.}"

Expand Down
2 changes: 1 addition & 1 deletion tests/auth/test_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_password_required(identity_provider_class, password_set, password_requi
app.identity_provider = idp
ctx = nullcontext() if ok else pytest.raises(SystemExit)

with ctx: # type:ignore[attr-defined]
with ctx:
idp.validate_security(app, ssl_options=None)


Expand Down
2 changes: 1 addition & 1 deletion tests/base/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def test_authenticated_file_handler(jp_serverapp, tmpdir):
for key in list(handler.settings):
if key != "contents_manager":
del handler.settings[key]
handler.check_xsrf_cookie = MagicMock() # type:ignore[assignment]
handler.check_xsrf_cookie = MagicMock() # type:ignore[method-assign]
handler._jupyter_current_user = "foo" # type:ignore[assignment]
with warnings.catch_warnings():
warnings.simplefilter("ignore")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def test_browser_open_files(jp_configurable_serverapp, should_exist, caplog):
assert os.path.exists(app.browser_open_file) == should_exist
url = urljoin("file:", pathname2url(app.browser_open_file))
url_messages = [rec.message for rec in caplog.records if url in rec.message]
assert url_messages if should_exist else not url_messages # type: ignore[truthy-bool]
assert url_messages if should_exist else not url_messages


def test_deprecated_notebook_dir_priority(jp_configurable_serverapp, tmp_path):
Expand Down
4 changes: 2 additions & 2 deletions tests/unix_sockets/test_serverapp_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def test_shutdown_sock_server_integration(jp_unix_socket_file):
# Fake out stopping the server.
app = JupyterServerStopApp(sock=str(jp_unix_socket_file))
app.initialize([])
app.shutdown_server = lambda _: True # type:ignore[assignment]
app._maybe_remove_unix_socket = lambda _: _ # type: ignore[assignment]
app.shutdown_server = lambda _: True # type:ignore[method-assign]
app._maybe_remove_unix_socket = lambda _: _ # type: ignore[method-assign]
app.start()

_check_output(["jupyter-server", "stop", jp_unix_socket_file])
Expand Down

0 comments on commit 30604b8

Please sign in to comment.