From 0e0853cc7071ce4ff1abcb2060f76ad336b6cbb6 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sun, 12 Oct 2025 11:49:53 +0200 Subject: [PATCH] functional2: handle unset or empty BUILD_TEST_SHELL properly If BUILD_TEST_SHELL is not set or empty, None or the empty string respectively should not make it into the PATH. Ensure this property. Change-Id: I4ce9b0c06c407b465308b63b9cb64e7d6a6a6964 --- tests/functional2/testlib/fixtures/env.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/functional2/testlib/fixtures/env.py b/tests/functional2/testlib/fixtures/env.py index b4e8ad92b..1bc8754e0 100644 --- a/tests/functional2/testlib/fixtures/env.py +++ b/tests/functional2/testlib/fixtures/env.py @@ -20,12 +20,13 @@ class _ManagedPath: Wrapper class to handle building the `PATH` environment variable """ - build_shell: dataclasses.InitVar[str] + build_shell: dataclasses.InitVar[str | None] """statically linked shell to use within builds which provides coreutils functionality""" _path: list[str] = dataclasses.field(default_factory=list) - def __post_init__(self, build_shell: str): - self.prepend(build_shell) + def __post_init__(self, build_shell: str | None): + if build_shell: + self.prepend(build_shell) def to_path(self) -> str: """