Merge pull request #1765 from umap-project/ci-mock-osm-tiles

Mock OSM tiles requests in Playwright for speed
This commit is contained in:
David Larlet 2024-04-19 09:54:39 -04:00 committed by GitHub
commit 5232d77382
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,13 @@ import pytest
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def set_timeout(context): 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 @pytest.fixture