Skip to content

Commit

Permalink
Make tools tree available in tests
Browse files Browse the repository at this point in the history
For use with find_binary() to check if binaries exist in the tools
tree.
  • Loading branch information
DaanDeMeyer committed Oct 7, 2024
1 parent 5e13084 commit 8df145a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ImageConfig:
distribution: Distribution
release: str
debug_shell: bool
tools: Optional[Path]


class Image:
Expand Down Expand Up @@ -64,6 +65,7 @@ def mkosi(
return run(
[
"python3", "-m", "mkosi",
*(["--tools-tree", self.config.tools] if self.config.tools else []),
"--debug",
*options,
verb,
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from collections.abc import Iterator
from pathlib import Path
from typing import Any, cast

import pytest
Expand Down Expand Up @@ -48,6 +49,7 @@ def config(request: Any) -> ImageConfig:
distribution=distribution,
release=release,
debug_shell=request.config.getoption("--debug-shell"),
tools=p if (p := Path("mkosi.tools").exists()) else None,
)


Expand Down

0 comments on commit 8df145a

Please sign in to comment.