From b69b2703780c84021a77356a03d1119c4f034473 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Fri, 24 Jan 2025 14:06:24 +0100 Subject: [PATCH] fix windows async tests --- tests/test_asyncio.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_asyncio.py b/tests/test_asyncio.py index 65a0ba7..e8f2cbd 100644 --- a/tests/test_asyncio.py +++ b/tests/test_asyncio.py @@ -1062,5 +1062,10 @@ async def test_connect_options(page): result.assert_outcomes(passed=1) finally: assert server_process - os.kill(server_process.pid, signal.SIGINT) + # TODO: Playwright CLI on Windows via Python does not forward the signal + # hence we need to send it to the whole process group. + if sys.platform == "win32": + subprocess.run(["taskkill", "/F", "/T", "/PID", str(server_process.pid)]) + else: + os.kill(server_process.pid, signal.SIGINT) server_process.wait()