Skip to content

Commit f28457f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 82c53cc commit f28457f

File tree

7 files changed

+15
-10
lines changed

7 files changed

+15
-10
lines changed

jupyter_server/auth/authorizer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# Distributed under the terms of the Modified BSD License.
1111
from __future__ import annotations
1212

13-
from typing import TYPE_CHECKING, Awaitable
13+
from collections.abc import Awaitable
14+
from typing import TYPE_CHECKING
1415

1516
from traitlets import Instance
1617
from traitlets.config import LoggingConfigurable

jupyter_server/base/handlers.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
import re
1414
import types
1515
import warnings
16+
from collections.abc import Awaitable, Coroutine, Sequence
1617
from http.client import responses
1718
from logging import Logger
18-
from typing import TYPE_CHECKING, Any, Awaitable, Coroutine, Sequence, cast
19+
from typing import TYPE_CHECKING, Any, cast
1920
from urllib.parse import urlparse
2021

2122
import prometheus_client

jupyter_server/files/handlers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import mimetypes
88
from base64 import decodebytes
9-
from typing import Awaitable
9+
from collections.abc import Awaitable
1010

1111
from jupyter_core.utils import ensure_async
1212
from tornado import web

tests/auth/test_authorizer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import asyncio
44
import json
55
import os
6-
from typing import Awaitable
6+
from collections.abc import Awaitable
77

88
import pytest
99
from jupyter_client.kernelspec import NATIVE_KERNEL_NAME

tests/services/api/test_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
2-
from typing import Awaitable, Dict, List
2+
from collections.abc import Awaitable
3+
from typing import Dict, List
34
from unittest import mock
45

56
import pytest

tests/services/contents/test_manager.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,10 @@ async def test_nb_validation(jp_contents_manager):
983983
# successful methods and ensure that calls to the aliased "validate_nb" are
984984
# zero. Note that since patching side-effects the validation error case, we'll
985985
# skip call-count assertions for that portion of the test.
986-
with patch("nbformat.validate") as mock_validate, patch(
987-
"jupyter_server.services.contents.manager.validate_nb"
988-
) as mock_validate_nb:
986+
with (
987+
patch("nbformat.validate") as mock_validate,
988+
patch("jupyter_server.services.contents.manager.validate_nb") as mock_validate_nb,
989+
):
989990
# Valid notebook, save, then get
990991
model = await ensure_async(cm.save(model, path))
991992
assert "message" not in model

tests/test_serverapp.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ async def test_generate_config(tmp_path, jp_configurable_serverapp):
154154

155155
def test_server_password(tmp_path, jp_configurable_serverapp):
156156
password = "secret"
157-
with patch.dict("os.environ", {"JUPYTER_CONFIG_DIR": str(tmp_path)}), patch.object(
158-
getpass, "getpass", return_value=password
157+
with (
158+
patch.dict("os.environ", {"JUPYTER_CONFIG_DIR": str(tmp_path)}),
159+
patch.object(getpass, "getpass", return_value=password),
159160
):
160161
app = JupyterPasswordApp(log_level=logging.ERROR)
161162
app.initialize([])

0 commit comments

Comments
 (0)