Skip to content

Commit

Permalink
test fixes for tornado 5.0
Browse files Browse the repository at this point in the history
c.f. notebook jupyter/notebook#3398
  • Loading branch information
jcb91 committed Mar 9, 2018
1 parent bd6561d commit e6d2a6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/nbextensions_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import logging
import os
import sys
from threading import Event, Thread

from jupyter_contrib_core.notebook_compat import serverextensions
Expand Down Expand Up @@ -117,6 +118,11 @@ def start_server_thread(cls, started_event):
app = cls.notebook = NoseyNotebookApp(**cls.get_server_kwargs())
# don't register signal handler during tests
app.init_signal = lambda: None
# start asyncio loop explicitly in notebook thread
# (tornado 4 starts per-thread loops automatically, asyncio doesn’t)
if 'asyncio' in sys.modules:
import asyncio
asyncio.set_event_loop(asyncio.new_event_loop())
app.initialize(argv=[])
loop = IOLoop.current()
loop.add_callback(started_event.set)
Expand Down

0 comments on commit e6d2a6a

Please sign in to comment.