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
10 changes: 6 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import asyncio
import contextlib
import os
import subprocess

Expand Down Expand Up @@ -36,8 +36,10 @@ def pytest_addoption(parser: Parser) -> None:

@pytest.fixture(autouse=True, scope="session")
def install_playwright():
subprocess.run(["playwright", "install", "chromium"], check=True) # noqa: S607, S603
subprocess.run(["playwright", "install-deps"], check=True) # noqa: S607, S603
subprocess.run(["playwright", "install", "chromium"], check=True) # noqa: S607
# Try to install system deps, but don't fail if already installed or no root access
with contextlib.suppress(subprocess.CalledProcessError):
subprocess.run(["playwright", "install-deps"], check=True) # noqa: S607


@pytest.fixture(autouse=True, scope="session")
Expand All @@ -49,7 +51,7 @@ def rebuild():
# passed to the subprocess.
env = os.environ.copy()
env.pop("HATCH_ENV_ACTIVE", None)
subprocess.run(["hatch", "build", "-t", "wheel"], check=True, env=env) # noqa: S607, S603
subprocess.run(["hatch", "build", "-t", "wheel"], check=True, env=env) # noqa: S607


@pytest.fixture(autouse=True, scope="function")
Expand Down
Loading