Author: Matti Picus <[email protected]>
Branch:
Changeset: r55150:55fecfe8d79c
Date: 2012-05-22 00:45 +0300
http://bitbucket.org/pypy/pypy/changeset/55fecfe8d79c/
Log: basic test for os.kill
diff --git a/pypy/rpython/module/test/test_ll_os.py
b/pypy/rpython/module/test/test_ll_os.py
--- a/pypy/rpython/module/test/test_ll_os.py
+++ b/pypy/rpython/module/test/test_ll_os.py
@@ -252,6 +252,25 @@
os.close(fd)
raises(OSError, f, fd)
+
+def test_os_kill():
+ try:
+ f = getllimpl(os.kill)
+ except:
+ skip('No kill in os')
+ import subprocess
+ import signal
+ proc = subprocess.Popen([sys.executable, "-c",
+ "import time;"
+ "time.sleep(10)",
+ ],
+ )
+ f(proc.pid, signal.SIGTERM)
+ expected = -signal.SIGTERM
+ if sys.platform.startswith('win'):
+ expected = -expected
+ assert proc.wait() == expected
+
class ExpectTestOs:
def setup_class(cls):
if not hasattr(os, 'ttyname'):
@@ -273,3 +292,4 @@
assert ll_to_string(interpret(f, [0])) == f(0)
assert ll_to_string(interpret(f, [338])) == ''
+
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit