From ab953111d4949b19014dbef5141fe26ba4d629a8 Mon Sep 17 00:00:00 2001 From: sebthom Date: Thu, 12 Dec 2024 22:09:57 +0100 Subject: [PATCH] ci: fix linux builds --- tests/test_web_scraping_mixin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_web_scraping_mixin.py b/tests/test_web_scraping_mixin.py index 92ab208..a572be9 100644 --- a/tests/test_web_scraping_mixin.py +++ b/tests/test_web_scraping_mixin.py @@ -3,7 +3,8 @@ SPDX-FileCopyrightText: © Sebastian Thomschke and contributors SPDX-License-Identifier: AGPL-3.0-or-later SPDX-ArtifactOfProjectHomePage: https://github.com/Second-Hand-Friends/kleinanzeigen-bot/ """ -import logging, os +import logging, os, platform +from typing import cast import nodriver, pytest @@ -17,6 +18,9 @@ if os.environ.get("CI"): async def atest_init() -> None: web_scraping_mixin = WebScrapingMixin() + if platform.system() == "Linux": + # required for Ubuntu 24.04 or newer + cast(list[str], web_scraping_mixin.browser_config.arguments).append("--no-sandbox") browser_path = web_scraping_mixin.get_compatible_browser() ensure(browser_path is not None, "Browser not auto-detected")