From b1dbfb54da41eb80d5d56c63e20984e1eda33350 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sat, 28 Nov 2026 11:49:19 -0500 Subject: [PATCH] test(handoff): find the module in the namespace run under discover too --- tools/tests/test_native_hook_handoff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/tests/test_native_hook_handoff.py b/tools/tests/test_native_hook_handoff.py index efa66fe81c..544ff43ac0 100644 --- a/tools/tests/test_native_hook_handoff.py +++ b/tools/tests/test_native_hook_handoff.py @@ -780,8 +780,11 @@ class NativeHookHandoffTest(unittest.TestCase): unshare = shutil.which("unshare") if not unshare or subprocess.run([unshare, "-Urpf", "--mount-proc", "true"], capture_output=True).returncode: self.skipTest("no user and pid namespace for this test") + # this module by the name it was loaded as, from the repository's root or this directory + here, top = Path(__file__).resolve().parent, Path(__file__).resolve().parents[2] + path = os.pathsep.join([str(here), str(top)] + ([os.environ["PYTHONPATH"]] if os.environ.get("PYTHONPATH") else [])) out = subprocess.run([unshare, "-Urpf", "--mount-proc", sys.executable, "-m", "unittest", self.id()], - env={**os.environ, "DDH_TEST_PIDNS": "1"}, cwd=Path(__file__).resolve().parents[2], + env={**os.environ, "DDH_TEST_PIDNS": "1", "PYTHONPATH": path}, cwd=top, capture_output=True, text=True, timeout=300) self.assertEqual(0, out.returncode, out.stderr) self.assertNotIn("skipped", out.stderr, out.stderr)