[svn r39655] add a (somewhat clunky) way to kill processes by PID both on windows
and unix-ish systems. --HG-- branch : trunk
This commit is contained in:
15
py/misc/testing/test_oskill.py
Normal file
15
py/misc/testing/test_oskill.py
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
import py, sys
|
||||
|
||||
from py.__.misc.killproc import killproc
|
||||
|
||||
def test_win_killsubprocess():
|
||||
tmp = py.test.ensuretemp("test_win_killsubprocess")
|
||||
t = tmp.join("t.py")
|
||||
t.write("import time ; time.sleep(100)")
|
||||
proc = py.std.subprocess.Popen([sys.executable, str(t)])
|
||||
assert proc.poll() is None # no return value yet
|
||||
killproc(proc.pid)
|
||||
ret = proc.wait()
|
||||
assert ret != 0
|
||||
|
||||
Reference in New Issue
Block a user