From 6bba19f6285f9d0d85cf2c84b66e8477e0e6581a Mon Sep 17 00:00:00 2001 From: Deeman Date: Fri, 13 Feb 2026 23:59:53 +0100 Subject: [PATCH] =?UTF-8?q?skip=20visual=20tests=20in=20CI=20=E2=80=94=20r?= =?UTF-8?q?equire=20explicit=20-m=20visual=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Playwright visual tests need browser binaries (playwright install chromium) which CI doesn't have. Mark them with pytest.mark.visual and add addopts = "-m 'not visual'" so they're skipped by default. Run locally with: uv run pytest -m visual tests/test_visual.py -v Co-Authored-By: Claude Opus 4.6 --- padelnomics/pyproject.toml | 2 ++ padelnomics/tests/test_visual.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/padelnomics/pyproject.toml b/padelnomics/pyproject.toml index 73fadf2..ae44751 100644 --- a/padelnomics/pyproject.toml +++ b/padelnomics/pyproject.toml @@ -43,3 +43,5 @@ ignore = ["E501"] [tool.pytest.ini_options] asyncio_mode = "auto" testpaths = ["tests"] +markers = ["visual: Playwright visual tests (require browser install)"] +addopts = "-m 'not visual'" diff --git a/padelnomics/tests/test_visual.py b/padelnomics/tests/test_visual.py index 5873021..a4cc399 100644 --- a/padelnomics/tests/test_visual.py +++ b/padelnomics/tests/test_visual.py @@ -4,8 +4,9 @@ Visual regression tests using Playwright. Takes screenshots of key pages and verifies styling invariants (heading colors, backgrounds, nav layout, logo presence). -Usage: - uv run pytest tests/test_visual.py -x -v +Skipped by default (requires `playwright install chromium`). +Run explicitly with: + uv run pytest -m visual tests/test_visual.py -v Screenshots are saved to tests/screenshots/ for manual review. """ @@ -21,6 +22,8 @@ from playwright.sync_api import expect, sync_playwright from padelnomics import core from padelnomics.app import create_app +pytestmark = pytest.mark.visual + SCREENSHOTS_DIR = Path(__file__).parent / "screenshots" SCREENSHOTS_DIR.mkdir(exist_ok=True)