diff --git a/ipykernel/kernelbase.py b/ipykernel/kernelbase.py index ad1100d8..3c7324d2 100644 --- a/ipykernel/kernelbase.py +++ b/ipykernel/kernelbase.py @@ -552,7 +552,9 @@ async def start(self, *, task_status: TaskStatus = TASK_STATUS_IGNORED) -> None: # Assign tasks to and start shell channel thread. manager = self.shell_channel_thread.manager self.shell_channel_thread.add_task(self.shell_channel_thread_main) - self.shell_channel_thread.add_task(manager.listen_from_control, self.shell_main, self.shell_channel_thread) + self.shell_channel_thread.add_task( + manager.listen_from_control, self.shell_main, self.shell_channel_thread + ) self.shell_channel_thread.add_task(manager.listen_from_subshells) self.shell_channel_thread.start() else: @@ -1082,7 +1084,9 @@ async def create_subshell_request(self, socket, ident, parent) -> None: # This should only be called in the control thread if it exists. # Request is passed to shell channel thread to process. - other_socket = await self.shell_channel_thread.manager.get_control_other_socket(self.control_thread.get_task_group()) + other_socket = await self.shell_channel_thread.manager.get_control_other_socket( + self.control_thread.get_task_group() + ) await other_socket.asend_json({"type": "create"}) reply = await other_socket.arecv_json() @@ -1104,7 +1108,9 @@ async def delete_subshell_request(self, socket, ident, parent) -> None: # This should only be called in the control thread if it exists. # Request is passed to shell channel thread to process. - other_socket = await self.shell_channel_thread.manager.get_control_other_socket(self.control_thread.get_task_group()) + other_socket = await self.shell_channel_thread.manager.get_control_other_socket( + self.control_thread.get_task_group() + ) await other_socket.asend_json({"type": "delete", "subshell_id": subshell_id}) reply = await other_socket.arecv_json() @@ -1119,7 +1125,9 @@ async def list_subshell_request(self, socket, ident, parent) -> None: # This should only be called in the control thread if it exists. # Request is passed to shell channel thread to process. - other_socket = await self.shell_channel_thread.manager.get_control_other_socket(self.control_thread.get_task_group()) + other_socket = await self.shell_channel_thread.manager.get_control_other_socket( + self.control_thread.get_task_group() + ) await other_socket.asend_json({"type": "list"}) reply = await other_socket.arecv_json() diff --git a/ipykernel/subshell_manager.py b/ipykernel/subshell_manager.py index c4530748..dbd3da76 100644 --- a/ipykernel/subshell_manager.py +++ b/ipykernel/subshell_manager.py @@ -234,7 +234,9 @@ def _is_subshell(self, subshell_id: str | None) -> bool: with self._lock_cache: return subshell_id in self._cache - async def _listen_for_subshell_reply(self, subshell_id: str | None, task_group: TaskGroup) -> None: + async def _listen_for_subshell_reply( + self, subshell_id: str | None, task_group: TaskGroup + ) -> None: """Listen for reply messages on specified subshell inproc socket and resend to the client via the shell_socket. diff --git a/tests/conftest.py b/tests/conftest.py index dfa7df5d..c981f867 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,10 +22,11 @@ resource = None # type:ignore -@pytest.fixture +@pytest.fixture() def anyio_backend(): return "asyncio" + pytestmark = pytest.mark.anyio diff --git a/tests/test_io.py b/tests/test_io.py index 1661d3eb..09add95f 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -197,7 +197,7 @@ async def subprocess_test_echo_watch(): @pytest.mark.anyio() -#@pytest.mark.skipif(sys.platform.startswith("win"), reason="Windows") +# @pytest.mark.skipif(sys.platform.startswith("win"), reason="Windows") @pytest.mark.skip(reason="FIXME") async def test_echo_watch(ctx): """Test echo on underlying FD while capturing the same FD