fix windows tests failing due to tornado bug

This commit is contained in:
Maximilian Hils 2020-08-27 00:08:23 +02:00
parent 83dac0e999
commit e31f69ff4a
2 changed files with 17 additions and 7 deletions

View File

@ -5,4 +5,5 @@ if sys.platform == 'win32':
# workaround for # workaround for
# https://github.com/tornadoweb/tornado/issues/2751 # https://github.com/tornadoweb/tornado/issues/2751
# https://www.tornadoweb.org/en/stable/index.html#installation # https://www.tornadoweb.org/en/stable/index.html#installation
# (copied multiple times in the codebase, please remove all occurrences)
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

View File

@ -3,16 +3,25 @@ import logging
from unittest import mock from unittest import mock
import os import os
import asyncio import asyncio
import sys
import pytest import pytest
import tornado.testing
from tornado import httpclient
from tornado import websocket
from mitmproxy import options if sys.platform == 'win32':
from mitmproxy.test import tflow # workaround for
from mitmproxy.tools.web import app # https://github.com/tornadoweb/tornado/issues/2751
from mitmproxy.tools.web import master as webmaster # https://www.tornadoweb.org/en/stable/index.html#installation
# (copied multiple times in the codebase, please remove all occurrences)
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
import tornado.testing # noqa
from tornado import httpclient # noqa
from tornado import websocket # noqa
from mitmproxy import options # noqa
from mitmproxy.test import tflow # noqa
from mitmproxy.tools.web import app # noqa
from mitmproxy.tools.web import master as webmaster # noqa
@pytest.fixture(scope="module") @pytest.fixture(scope="module")