From eb297d82aafe3f3880e35676eba9361f4f459110 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sat, 24 Mar 2018 11:19:03 +0100 Subject: [PATCH] fix Tornado 5.0 event loop https://github.com/tornadoweb/tornado/issues/2183#issuecomment-371001254 --- setup.py | 2 +- test/mitmproxy/addons/test_onboarding.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 88d46ec5a..d973249fe 100644 --- a/setup.py +++ b/setup.py @@ -77,7 +77,7 @@ setup( "pyperclip>=1.6.0, <1.7", "ruamel.yaml>=0.13.2, <0.16", "sortedcontainers>=1.5.4, <1.6", - "tornado>=4.3, <4.6", + "tornado>=4.3,<5.1", "urwid>=2.0.1,<2.1", "wsproto>=0.11.0,<0.12.0", ], diff --git a/test/mitmproxy/addons/test_onboarding.py b/test/mitmproxy/addons/test_onboarding.py index 810ddef1d..0d99b1ffd 100644 --- a/test/mitmproxy/addons/test_onboarding.py +++ b/test/mitmproxy/addons/test_onboarding.py @@ -4,6 +4,10 @@ from mitmproxy.addons import onboarding from mitmproxy.test import taddons from .. import tservers +import asyncio +import tornado.platform.asyncio +asyncio.set_event_loop_policy(tornado.platform.asyncio.AnyThreadEventLoopPolicy()) + class TestApp(tservers.HTTPProxyTest): def addons(self):