File tree Expand file tree Collapse file tree 4 files changed +27
-19
lines changed Expand file tree Collapse file tree 4 files changed +27
-19
lines changed Original file line number Diff line number Diff line change @@ -1390,14 +1390,16 @@ def init_configurables(self):
13901390 connection_dir = self .runtime_dir ,
13911391 kernel_spec_manager = self .kernel_spec_manager ,
13921392 )
1393- # Ensure the appropriate jupyter_client is in place .
1393+ # Ensure the appropriate version of Python and jupyter_client is available .
13941394 if isinstance (self .kernel_manager , AsyncMappingKernelManager ):
1395+ if sys .version_info < (3 , 6 ):
1396+ raise ValueError ("You are using `AsyncMappingKernelManager` in Python 3.5 (or lower) "
1397+ "which is not supported. Please upgrade Python to 3.6+ or change kernel managers." )
13951398 if not async_kernel_mgmt_available :
13961399 raise ValueError ("You are using `AsyncMappingKernelManager` without an appropriate "
1397- "jupyter_client installed! Upgrade jupyter_client or change kernel managers." )
1398- else :
1399- self .log .info ("Asynchronous kernel management has been configured to use '{}'." .
1400- format (self .kernel_manager .__class__ .__name__ ))
1400+ "jupyter_client installed! Please upgrade jupyter_client or change kernel managers." )
1401+ self .log .info ("Asynchronous kernel management has been configured to use '{}'." .
1402+ format (self .kernel_manager .__class__ .__name__ ))
14011403
14021404 self .contents_manager = self .contents_manager_class (
14031405 parent = self ,
Original file line number Diff line number Diff line change 3535except ImportError :
3636 class AsyncMultiKernelManager (object ):
3737 """Empty class to satisfy unused reference by AsyncMappingKernelManager."""
38- pass
38+ def __init__ (self , ** kwargs ):
39+ pass
3940
4041
4142class MappingKernelManager (MultiKernelManager ):
Original file line number Diff line number Diff line change 11"""Test the kernels service API."""
22
33import json
4+ import sys
45import time
56
67from traitlets .config import Config
@@ -198,6 +199,14 @@ def test_connections(self):
198199class AsyncKernelAPITest (KernelAPITest ):
199200 """Test the kernels web service API using the AsyncMappingKernelManager"""
200201
202+ @classmethod
203+ def setup_class (cls ):
204+ if not async_testing_enabled :
205+ raise SkipTest ("AsyncKernelAPITest tests skipped due to down-level jupyter_client!" )
206+ if sys .version_info < (3 , 6 ):
207+ raise SkipTest ("AsyncKernelAPITest tests skipped due to Python < 3.6!" )
208+ super (AsyncKernelAPITest , cls ).setup_class ()
209+
201210 @classmethod
202211 def get_argv (cls ):
203212 argv = super (AsyncKernelAPITest , cls ).get_argv ()
@@ -209,12 +218,6 @@ def get_argv(cls):
209218 'notebook.services.kernels.kernelmanager.AsyncMappingKernelManager' ])
210219 return argv
211220
212- def setUp (self ):
213- if not async_testing_enabled :
214- raise SkipTest ("AsyncKernelAPITest.{test_method} skipped due to down-level jupyter_client!" .
215- format (test_method = self ._testMethodName ))
216- super (AsyncKernelAPITest , self ).setUp ()
217-
218221
219222class KernelFilterTest (NotebookTestBase ):
220223
Original file line number Diff line number Diff line change 55import io
66import os
77import json
8- import requests
98import shutil
9+ import sys
1010import time
1111
1212from unittest import SkipTest
@@ -269,6 +269,14 @@ def test_modify_kernel_id(self):
269269class AsyncSessionAPITest (SessionAPITest ):
270270 """Test the sessions web service API using the AsyncMappingKernelManager"""
271271
272+ @classmethod
273+ def setup_class (cls ):
274+ if not async_testing_enabled :
275+ raise SkipTest ("AsyncSessionAPITest tests skipped due to down-level jupyter_client!" )
276+ if sys .version_info < (3 , 6 ):
277+ raise SkipTest ("AsyncSessionAPITest tests skipped due to Python < 3.6!" )
278+ super (AsyncSessionAPITest , cls ).setup_class ()
279+
272280 @classmethod
273281 def get_argv (cls ):
274282 argv = super (AsyncSessionAPITest , cls ).get_argv ()
@@ -280,9 +288,3 @@ def get_argv(cls):
280288 'notebook.services.kernels.kernelmanager.AsyncMappingKernelManager' ])
281289
282290 return argv
283-
284- def setUp (self ):
285- if not async_testing_enabled :
286- raise SkipTest ("AsyncSessionAPITest.{test_method} skipped due to down-level jupyter_client!" .
287- format (test_method = self ._testMethodName ))
288- super (AsyncSessionAPITest , self ).setUp ()
You can’t perform that action at this time.
0 commit comments