[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:
hpk
2007-03-02 12:00:32 +01:00
parent 2cd886f442
commit 40b28ca0fe
3 changed files with 28 additions and 1 deletions

View 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