Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import asyncio
import os

import pytest
Expand Down Expand Up @@ -50,14 +51,14 @@ async def page(browser):

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


@pytest.fixture(scope="session")
def event_loop():
if os.name == "nt": # pragma: no cover
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
with open_event_loop() as loop:
yield loop

Expand Down