Skip to content

Commit 50e42c0

Browse files
authored
set event loop policy for windows (#820)
1 parent 688a16d commit 50e42c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: tests/conftest.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import asyncio
34
import os
45

56
import pytest
@@ -50,14 +51,14 @@ async def page(browser):
5051

5152
@pytest.fixture(scope="session")
5253
async def browser(pytestconfig: Config):
53-
if os.name == "nt": # pragma: no cover
54-
pytest.skip("Browser tests not supported on Windows")
5554
async with async_playwright() as pw:
5655
yield await pw.chromium.launch(headless=not bool(pytestconfig.option.headed))
5756

5857

5958
@pytest.fixture(scope="session")
6059
def event_loop():
60+
if os.name == "nt": # pragma: no cover
61+
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
6162
with open_event_loop() as loop:
6263
yield loop
6364

0 commit comments

Comments
 (0)