diff --git a/pyproject.toml b/pyproject.toml index 3ddae716..95bda5eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,8 +130,7 @@ filterwarnings= [ # Fail on warnings "error", # from python-dateutil - "ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning", - "ignore:datetime.datetime.utcnow:DeprecationWarning", + "ignore:datetime.datetime.utc:DeprecationWarning", ] [tool.coverage.report] diff --git a/tests/test_multikernelmanager.py b/tests/test_multikernelmanager.py index 00eed5e3..4e6dc26c 100644 --- a/tests/test_multikernelmanager.py +++ b/tests/test_multikernelmanager.py @@ -82,6 +82,7 @@ def _run_lifecycle(km, test_kid=None): km.shutdown_kernel(kid, now=True) assert kid not in km, f"{kid} not in {km}" kc.stop_channels() + km.context.destroy() def _run_cinfo(self, km, transport, ip): kid = km.start_kernel(stdout=PIPE, stderr=PIPE) @@ -285,13 +286,16 @@ async def _run_lifecycle(km, test_kid=None): await fut assert kid in km.list_kernel_ids() k = km.get_kernel(kid) + kc = k.client() assert isinstance(k, AsyncKernelManager) await km.shutdown_kernel(kid, now=True) assert kid not in km, f"{kid} not in {km}" + kc.stop_channels() + km.context.destroy() async def _run_cinfo(self, km, transport, ip): kid = await km.start_kernel(stdout=PIPE, stderr=PIPE) - km.get_kernel(kid) + k = km.get_kernel(kid) cinfo = km.get_connection_info(kid) assert transport == cinfo["transport"] assert ip == cinfo["ip"] @@ -305,8 +309,10 @@ async def _run_cinfo(self, km, transport, ip): assert "hb_port" in cinfo stream = km.connect_hb(kid) stream.close() + kc = k.client() await km.shutdown_kernel(kid, now=True) assert kid not in km + kc.stop_channels() async def test_tcp_lifecycle(self): await self.raw_tcp_lifecycle()