File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ def pytest_addoption(parser) -> None:
2020
2121@pytest .fixture
2222async def display (backend , browser ):
23- if sys .platform == "win32" :
24- asyncio .set_event_loop_policy (asyncio .WindowsProactorEventLoopPolicy ())
2523 async with DisplayFixture (backend , browser ) as display_fixture :
2624 display_fixture .page .set_default_timeout (10000 )
2725 yield display_fixture
@@ -37,3 +35,10 @@ async def backend():
3735async def browser (pytestconfig ):
3836 async with async_playwright () as pw :
3937 yield await pw .chromium .launch (headless = True if GITHUB_ACTIONS else pytestconfig .getoption ("headless" ))
38+
39+
40+ @pytest .fixture
41+ def event_loop_policy (request ):
42+ if sys .platform == "win32" :
43+ return asyncio .WindowsProactorEventLoopPolicy ()
44+ return asyncio .get_event_loop_policy ()
You can’t perform that action at this time.
0 commit comments