mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
tornado 5 fixes in tests
- start asyncio loop explicitly in notebook thread (tornado 4 starts per-thread loops automatically, asyncio doesn’t) - remove unsupported ‘io_loop=‘ arg in websocket test application runs fine with tornado 5, just a few test bits needed updating
This commit is contained in:
parent
95a8340063
commit
f77e3435cf
@ -53,11 +53,12 @@ class KernelAPI(object):
|
||||
|
||||
def websocket(self, id):
|
||||
loop = IOLoop()
|
||||
loop.make_current()
|
||||
req = HTTPRequest(
|
||||
url_path_join(self.base_url.replace('http', 'ws', 1), 'api/kernels', id, 'channels'),
|
||||
headers=self.headers,
|
||||
)
|
||||
f = websocket_connect(req, io_loop=loop)
|
||||
f = websocket_connect(req)
|
||||
return loop.run_sync(lambda : f)
|
||||
|
||||
|
||||
|
@ -135,6 +135,9 @@ class NotebookTestBase(TestCase):
|
||||
|
||||
started = Event()
|
||||
def start_thread():
|
||||
if 'asyncio' in sys.modules:
|
||||
import asyncio
|
||||
asyncio.set_event_loop(asyncio.new_event_loop())
|
||||
app = cls.notebook = NotebookApp(
|
||||
port=cls.port,
|
||||
port_retries=0,
|
||||
|
Loading…
Reference in New Issue
Block a user