Skip to content

Commit d84f605

Browse files
committed
Fix: tests failing when 'playwright install-deps' has already been done as part of the host/container provisioning.
1 parent 51198af commit d84f605

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ def pytest_addoption(parser: Parser) -> None:
3737
@pytest.fixture(autouse=True, scope="session")
3838
def install_playwright():
3939
subprocess.run(["playwright", "install", "chromium"], check=True) # noqa: S607, S603
40-
subprocess.run(["playwright", "install-deps"], check=True) # noqa: S607, S603
40+
# Try to install system deps, but don't fail if already installed or no root access
41+
try:
42+
subprocess.run(["playwright", "install-deps"], check=True) # noqa: S607, S603
43+
except subprocess.CalledProcessError:
44+
# Deps may already be installed (e.g., via Dockerfile) or we may not have root access
45+
# The actual browser launch will fail if deps are truly missing
46+
pass
4147

4248

4349
@pytest.fixture(autouse=True, scope="session")

0 commit comments

Comments
 (0)