1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-18 14:28:08 +00:00

Use the ProactorEventLoop on Windows.

This commit is contained in:
grossmj 2020-06-16 14:08:17 +09:30
parent d3ea67da24
commit 1d4c3a164d
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,12 @@ from .handlers.api.base import Query
sys._called_from_test = True sys._called_from_test = True
sys.original_platform = sys.platform sys.original_platform = sys.platform
if sys.platform.startswith("win"):
import asyncio
# use the Proactor event loop on Windows
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
@pytest.fixture(scope='function') @pytest.fixture(scope='function')
async def http_client(aiohttp_client): async def http_client(aiohttp_client):

View File

@ -70,7 +70,7 @@ async def test_web_ui(http_client, tmpdir):
f.write('world') f.write('world')
response = await http_client.get('/static/web-ui/testing.txt') response = await http_client.get('/static/web-ui/testing.txt')
assert response.status == 200 assert response.status == 200
os.remove(get_static('web-ui/testing.txt')) os.remove(tmpfile)
async def test_web_ui_not_found(http_client, tmpdir): async def test_web_ui_not_found(http_client, tmpdir):