diff --git a/kernel_gateway/tests/test_gatewayapp.py b/kernel_gateway/tests/test_gatewayapp.py index aab009a..3216904 100644 --- a/kernel_gateway/tests/test_gatewayapp.py +++ b/kernel_gateway/tests/test_gatewayapp.py @@ -7,7 +7,7 @@ import os from kernel_gateway.gatewayapp import KernelGatewayApp, ioloop from ..notebook_http.swagger.handlers import SwaggerSpecHandler -from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase +from tornado.testing import AsyncHTTPTestCase, ExpectLog RESOURCES = os.path.join(os.path.dirname(__file__), 'resources') @@ -66,7 +66,7 @@ def test_config_env_vars(self): self.assertEqual(app.certfile, '/test/fake.crt') self.assertEqual(app.client_ca, '/test/fake_ca.crt') -class TestGatewayAppBase(AsyncHTTPTestCase, LogTrapTestCase): +class TestGatewayAppBase(AsyncHTTPTestCase, ExpectLog): """Base class for integration style tests using HTTP/Websockets against an instance of the gateway app. diff --git a/kernel_gateway/tests/test_notebook_http.py b/kernel_gateway/tests/test_notebook_http.py index 8bc915d..50e5eac 100644 --- a/kernel_gateway/tests/test_notebook_http.py +++ b/kernel_gateway/tests/test_notebook_http.py @@ -381,13 +381,25 @@ def test_concurrent_request_should_not_be_blocked(self): method='GET', raise_error=False ) - self.assertTrue(response_long_running.running(), 'Long HTTP Request is not running') + if callable(getattr(response_long_running, 'done', "")): + # Tornado 5 + self.assertFalse(response_long_running.done(), 'Long HTTP Request is not running') + else: + # Tornado 4 + self.assertTrue(response_long_running.running(), 'Long HTTP Request is not running') + response_short_running = yield self.http_client.fetch( self.get_url('/sleep/3'), method='GET', raise_error=False ) - self.assertTrue(response_long_running.running(), 'Long HTTP Request is not running') + if callable(getattr(response_long_running, 'done', "")): + # Tornado 5 + self.assertFalse(response_long_running.done(), 'Long HTTP Request is not running') + else: + # Tornado 4 + self.assertTrue(response_long_running.running(), 'Long HTTP Request is not running') + self.assertEqual(response_short_running.code, 200, 'Short HTTP Request did not return proper status code of 200') @gen_test diff --git a/requirements.txt b/requirements.txt index 9a36160..f20794a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ jupyter_core>=4.0 jupyter_client>=4.2.0 notebook>=5.0.0 traitlets>=4.2.0 -tornado>=4.2.0,<5.0 +tornado>=4.2.0 requests>=2.7,<3.0 diff --git a/setup.py b/setup.py index f009a1d..49e80f6 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ 'jupyter_client>=4.2.0', 'notebook>=5.0.0,<6.0', 'traitlets>=4.2.0', - 'tornado>=4.2.0,<5.0', + 'tornado>=4.2.0', 'requests>=2.7,<3.0' ], classifiers=[