From f77e3435cf2cfd3e23d7216e32962921a2d783f5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 5 Mar 2018 23:10:56 +0100 Subject: [PATCH 1/2] tornado 5 fixes in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- notebook/services/kernels/tests/test_kernels_api.py | 3 ++- notebook/tests/launchnotebook.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/notebook/services/kernels/tests/test_kernels_api.py b/notebook/services/kernels/tests/test_kernels_api.py index 5358a20947..27d19709ec 100644 --- a/notebook/services/kernels/tests/test_kernels_api.py +++ b/notebook/services/kernels/tests/test_kernels_api.py @@ -53,11 +53,12 @@ def restart(self, id): 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) diff --git a/notebook/tests/launchnotebook.py b/notebook/tests/launchnotebook.py index 492e6c8974..43c98814af 100644 --- a/notebook/tests/launchnotebook.py +++ b/notebook/tests/launchnotebook.py @@ -135,6 +135,9 @@ def tmp(*parts): 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, From a9d2c17f74ee876516129c55190ce890ea0db89f Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 5 Mar 2018 23:11:23 +0100 Subject: [PATCH 2/2] =?UTF-8?q?install=20test=20dependencies=20with=20?= =?UTF-8?q?=E2=80=94pre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to get more warning about upcoming releases that might cause breakages --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c934cce4f..7068841022 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,6 @@ before_install: if [[ $GROUP == js* ]]; then npm install -g casperjs@1.1.3 phantomjs-prebuilt@2.1.7 fi - - git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels - | if [[ $GROUP == docs ]]; then pip install -r docs/doc-requirements.txt @@ -50,7 +49,7 @@ before_install: fi install: - - pip install -f travis-wheels/wheelhouse file://$PWD#egg=notebook[test] + - pip install --pre .[test] - wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb