本文整理汇总了Python中webkitpy.common.system.executive.Executive.kill_process方法的典型用法代码示例。如果您正苦于以下问题:Python Executive.kill_process方法的具体用法?Python Executive.kill_process怎么用?Python Executive.kill_process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.common.system.executive.Executive
的用法示例。
在下文中一共展示了Executive.kill_process方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def test_kill_process(self):
executive = Executive()
process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
# Killing again should fail silently.
executive.kill_process(process.pid)
示例2: test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def test_kill_process(self):
executive = Executive()
# FIXME: This may need edits to work right on windows.
# We use "yes" because it loops forever.
process = subprocess.Popen(["yes"], stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
self.assertEqual(process.wait(), -signal.SIGKILL)
# Killing again should fail silently.
executive.kill_process(process.pid)
示例3: serial_test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def serial_test_kill_process(self):
if sys.platform in ("win32", "cygwin"):
return # Windows does not return consistent exit codes.
executive = Executive()
process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
self.assertEqual(process.wait(), -signal.SIGKILL)
# Killing again should fail silently.
executive.kill_process(process.pid)
示例4: test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def test_kill_process(self):
executive = Executive()
process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
# Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
if sys.platform == "win32":
expected_exit_code = 1
else:
expected_exit_code = -signal.SIGKILL
self.assertEqual(process.wait(), expected_exit_code)
# Killing again should fail silently.
executive.kill_process(process.pid)
示例5: test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def test_kill_process(self):
executive = Executive()
# We use "yes" because it loops forever.
process = subprocess.Popen(["yes"], stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
# Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
if sys.platform == "win32":
expected_exit_code = 0 # taskkill.exe results in exit(0)
else:
expected_exit_code = -signal.SIGKILL
self.assertEqual(process.wait(), expected_exit_code)
# Killing again should fail silently.
executive.kill_process(process.pid)
示例6: test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def test_kill_process(self):
executive = Executive()
process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
# Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
if sys.platform == "win32":
# FIXME: https://bugs.webkit.org/show_bug.cgi?id=54790
# We seem to get either 0 or 1 here for some reason.
self.assertTrue(process.wait() in (0, 1))
else:
expected_exit_code = -signal.SIGKILL
self.assertEqual(process.wait(), expected_exit_code)
# Killing again should fail silently.
executive.kill_process(process.pid)
示例7: serial_test_kill_process
# 需要导入模块: from webkitpy.common.system.executive import Executive [as 别名]
# 或者: from webkitpy.common.system.executive.Executive import kill_process [as 别名]
def serial_test_kill_process(self):
executive = Executive()
process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid)
# Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
if sys.platform == "win32":
# FIXME: https://bugs.webkit.org/show_bug.cgi?id=54790
# We seem to get either 0 or 1 here for some reason.
self.assertIn(process.wait(), (0, 1))
elif sys.platform == "cygwin":
# FIXME: https://bugs.webkit.org/show_bug.cgi?id=98196
# cygwin seems to give us either SIGABRT or SIGKILL
# Native Windows (via Cygwin) returns ENOTBLK (-15)
self.assertIn(process.wait(), (-signal.SIGABRT, -signal.SIGKILL, -15))
else:
expected_exit_code = -signal.SIGTERM
self.assertEqual(process.wait(), expected_exit_code)
# Killing again should fail silently.
executive.kill_process(process.pid)