]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
tests: Skip test_tools() when in sandbox 3788/head
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Tue, 1 Jul 2025 20:44:46 +0000 (22:44 +0200)
committerDaanDeMeyer <daan.j.demeyer@gmail.com>
Tue, 1 Jul 2025 20:47:13 +0000 (22:47 +0200)
If we're running inside mkosi sandbox, we don't parse the default
tools tree configuration, which this test depends on, so skip it
when running in the sandbox.

tests/test_config.py

index ff9c2b9febd0982962e9562793c24ad705f18cce..acd446adf749bf239a0b60d2c447b8841126ce77 100644 (file)
@@ -21,6 +21,7 @@ from mkosi.config import (
     OutputFormat,
     Verb,
     config_parse_bytes,
+    in_sandbox,
     parse_config,
     parse_ini,
 )
@@ -1486,6 +1487,9 @@ def test_tools(tmp_path: Path) -> None:
     d = tmp_path
     argv = ["--tools-tree=default"]
 
+    if in_sandbox():
+        pytest.skip("Cannot run test_tools() test within mkosi sandbox environment")
+
     with resource_path(mkosi.resources) as resources, chdir(d):
         _, tools, _ = parse_config(argv, resources=resources)
         assert tools