[pypy-commit] pypy cpyext-ext: add a failing test

mattip pypy.commits at gmail.com
Sat Feb 27 23:18:52 EST 2016


Author: mattip <matti.picus at gmail.com>
Branch: cpyext-ext
Changeset: r82594:fc01e33f1288
Date: 2016-02-27 20:56 -0500
http://bitbucket.org/pypy/pypy/changeset/fc01e33f1288/

Log:	add a failing test

diff --git a/pypy/module/cpyext/test/test_pyerrors.py b/pypy/module/cpyext/test/test_pyerrors.py
--- a/pypy/module/cpyext/test/test_pyerrors.py
+++ b/pypy/module/cpyext/test/test_pyerrors.py
@@ -102,7 +102,15 @@
         assert api.PyExceptionInstance_Class(instance) is space.w_ValueError
 
     def test_interrupt_occurred(self, space, api):
-        assert False # XXX test PyOS_InterruptOccurred
+        assert not api.PyOS_InterruptOccurred()
+        import signal, os
+        recieved = []
+        def default_int_handler(*args):
+            recieved.append('ok')
+        signal.signal(signal.SIGINT, default_int_handler)
+        os.kill(os.getpid(), signal.SIGINT)
+        assert recieved == ['ok']
+        assert api.PyOS_InterruptOccurred()
 
 class AppTestFetch(AppTestCpythonExtensionBase):
 


More information about the pypy-commit mailing list