Skip to content

Commit

Permalink
typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer committed Dec 5, 2023
1 parent 283dc93 commit 6a2a111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jupyter_server/auth/authorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Authorizer(LoggingConfigurable):

def is_authorized(
self, handler: JupyterHandler, user: User, action: str, resource: str
) -> Awaitable | bool:
) -> Awaitable[bool] | bool:
"""A method to determine if ``user`` is authorized to perform ``action``
(read, write, or execute) on the ``resource`` type.
Expand Down
4 changes: 2 additions & 2 deletions tests/auth/test_authorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ class AsyncAuthorizerTest(Authorizer):

called = Bool(False)

async def mock_async_fetch(self):
async def mock_async_fetch(self) -> True:
"""Mock an async fetch"""
# Mock a hang for a half a second.
await asyncio.sleep(0.5)
return True

async def is_authorized(
self, handler: JupyterHandler, user: User, action: str, resource: str
) -> Awaitable | bool:
) -> Awaitable[bool]:
response = await self.mock_async_fetch()
self.called = True
return response
Expand Down

0 comments on commit 6a2a111

Please sign in to comment.