diff --git a/tests/test_runserver_main.py b/tests/test_runserver_main.py index 5e7938e9..2f0d9a9e 100644 --- a/tests/test_runserver_main.py +++ b/tests/test_runserver_main.py @@ -120,7 +120,7 @@ async def hello(request): @forked -def test_start_runserver_with_multi_app_modules(tmpworkdir, capfd): +async def test_start_runserver_with_multi_app_modules(tmpworkdir, capfd): mktree(tmpworkdir, { "app.py": f"""\ from aiohttp import web @@ -149,10 +149,13 @@ async def create_app(): app_task = AppTask(config) app_task._start_dev_server() - app_task._process.join(2) + try: + app_task._process.join(2) - captured = capfd.readouterr() - assert captured.out == "" + captured = capfd.readouterr() + assert captured.out == "" + finally: + await app_task._stop_dev_server() @forked