diff --git a/tests/conftest.py b/tests/conftest.py index 29f69b50..81041a2a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,6 +21,12 @@ from .handlers.api.base import Query sys._called_from_test = True 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') async def http_client(aiohttp_client): diff --git a/tests/handlers/test_index.py b/tests/handlers/test_index.py index a119d7c0..021ceeed 100644 --- a/tests/handlers/test_index.py +++ b/tests/handlers/test_index.py @@ -70,7 +70,7 @@ async def test_web_ui(http_client, tmpdir): f.write('world') response = await http_client.get('/static/web-ui/testing.txt') 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):