Author: Carl Friedrich Bolz <[email protected]>
Branch: py3.5
Changeset: r88303:e15a627f9333
Date: 2016-11-10 19:50 +0100
http://bitbucket.org/pypy/pypy/changeset/e15a627f9333/

Log:    add a failing test about typecode y# (more failing tests in this
        file anyway)

diff --git a/pypy/module/cpyext/test/test_getargs.py 
b/pypy/module/cpyext/test/test_getargs.py
--- a/pypy/module/cpyext/test/test_getargs.py
+++ b/pypy/module/cpyext/test/test_getargs.py
@@ -200,3 +200,16 @@
             return PyLong_FromSsize_t(y);
             ''', PY_SSIZE_T_CLEAN=True)
         assert charbuf(b'12345') == 5
+
+    def test_pyarg_parse_with_py_ssize_t_bytes(self):
+        charbuf = self.import_parser(
+            '''
+            char *buf;
+            Py_ssize_t len = -1;
+            if (!PyArg_ParseTuple(args, "y#", &buf, &len)) {
+                return NULL;
+            }
+            return PyBytes_FromStringAndSize(buf, len);
+            ''', PY_SSIZE_T_CLEAN=True)
+        assert type(charbuf(b'12345')) is bytes
+        assert charbuf(b'12345') == b'12345'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to