From 836c3361d782df73e05e8fb19de81d4d9f7ebd7f Mon Sep 17 00:00:00 2001 From: David Larlet Date: Thu, 18 Apr 2024 14:08:57 -0400 Subject: [PATCH] ci: mock OSM tiles requests in Playwright for speed Also, cast the PLAYWRIGHT_TIMEOUT parameter. --- umap/tests/integration/conftest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/umap/tests/integration/conftest.py b/umap/tests/integration/conftest.py index 89a115e9..b9e24e52 100644 --- a/umap/tests/integration/conftest.py +++ b/umap/tests/integration/conftest.py @@ -5,7 +5,13 @@ import pytest @pytest.fixture(autouse=True) def set_timeout(context): - context.set_default_timeout(os.environ.get("PLAYWRIGHT_TIMEOUT", 7500)) + context.set_default_timeout(int(os.environ.get("PLAYWRIGHT_TIMEOUT", 7500))) + + +@pytest.fixture(autouse=True) +def mock_osm_tiles(page): + if not bool(os.environ.get("PLAYWRIGHT_USE_TILES", False)): + page.route("*/**/osmfr/**", lambda route: route.fulfill()) @pytest.fixture