mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
test(handoff): find the module in the namespace run under discover too
This commit is contained in:
1 parent
61bc8e03b2
commit
b1dbfb54da
1 file changed
+4
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user