[pypy-commit] pypy default: add a failing test

antocuni noreply at buildbot.pypy.org
Fri Nov 22 19:00:29 CET 2013


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r68283:a3c3b75a7f2b
Date: 2013-11-22 18:58 +0100
http://bitbucket.org/pypy/pypy/changeset/a3c3b75a7f2b/

Log:	add a failing test

diff --git a/pypy/module/cpyext/test/test_ndarrayobject.py b/pypy/module/cpyext/test/test_ndarrayobject.py
--- a/pypy/module/cpyext/test/test_ndarrayobject.py
+++ b/pypy/module/cpyext/test/test_ndarrayobject.py
@@ -286,3 +286,20 @@
         assert dt.num == 11
 
 
+    def test_pass_ndarray_object_to_c(self):
+        skip('fixme')
+        from _numpypy.multiarray import ndarray
+        mod = self.import_extension('foo', [
+                ("check_array", "METH_VARARGS",
+                '''
+                    PyObject* obj;
+                    if (!PyArg_ParseTuple(args, "O!", &PyArray_Type, &obj))
+                        return NULL;
+                    Py_INCREF(obj);
+                    return obj;
+                '''),
+                ], prologue='#include <numpy/arrayobject.h>')
+        array = ndarray((3, 4), dtype='d')
+        assert mod.check_array(array) is array
+        raises(TypeError, "mod.check_array(42)")
+        


More information about the pypy-commit mailing list