Hide transient command windows

This commit is contained in:
王鹏
2026-10-09 16:11:08 +08:00
parent 11cec27774
commit 6c79ce0b26
4 changed files with 24 additions and 1 deletions

View File

@@ -43,6 +43,8 @@ class DeployerTests(unittest.TestCase):
self.assertEqual(output, ["npm ERR! ⚠ dependency failed", "安装失败"])
self.assertNotIn("text", popen_options)
self.assertEqual(popen_options["env"]["JAVA_HOME"], str(Path.cwd() / "fake-jdk"))
expected_flags = getattr(subprocess, "CREATE_NO_WINDOW", 0) if os.name == "nt" else 0
self.assertEqual(popen_options["creationflags"], expected_flags)
self.assertEqual(
Path(popen_options["env"]["PATH"].split(os.pathsep)[0]),
npm.parent,