From 25dbc97e68d99510c7b10aa7cd1cce57d88ed526 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 27 Nov 2026 22:32:40 -0500 Subject: [PATCH] test(native): run the popen test program with a clean environment --- tools/tests/test_native_hook_popen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/tests/test_native_hook_popen.py b/tools/tests/test_native_hook_popen.py index 106d7b88c5..56499a9b3e 100644 --- a/tools/tests/test_native_hook_popen.py +++ b/tools/tests/test_native_hook_popen.py @@ -77,7 +77,8 @@ class NativeHookPopenTest(unittest.TestCase): def run_program(self, mode): hook_env = {"DDNATV_ROOT": str(self.root), "LD_PRELOAD": str(self.hook)} - env = {k: v for k, v in os.environ.items() if k not in hook_env} + # Only what the program needs: other test modules in the same run change os.environ + env = {"PATH": os.environ.get("PATH", "/usr/bin:/bin")} if self.prefix: cmd = list(self.prefix) + [arg for key, value in hook_env.items() for arg in ("-E", f"{key}={value}")] else: