Skip to content

Commit

Permalink
more typing cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed May 5, 2022
1 parent 611e29a commit abd2afb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nbclient/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test_mock_wrapper(self):
execute=MagicMock(return_value=parent_id),
is_alive=MagicMock(return_value=make_async(True)),
)
executor.parent_id = parent_id # type:ignore
executor.parent_id = parent_id
return func(self, executor, cell_mock, message_mock)

return test_mock_wrapper
Expand Down
7 changes: 5 additions & 2 deletions nbclient/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import asyncio
import inspect
import sys
from typing import Any, Awaitable, Callable, Optional, Union
from typing import Any, Awaitable, Callable, Optional, TypeVar, Union


def check_ipython() -> None:
Expand Down Expand Up @@ -62,7 +62,10 @@ def just_run(coro: Awaitable) -> Any:
return loop.run_until_complete(coro)


def run_sync(coro: Callable) -> Callable:

T = TypeVar("T")

def run_sync(coro: Callable[..., T]) -> Callable[..., T]:
"""Runs a coroutine and blocks until it has executed.
An event loop is created if no one already exists. If an event loop is
Expand Down

0 comments on commit abd2afb

Please sign in to comment.