Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windows tests #820

Merged
merged 1 commit into from
Oct 18, 2022
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