[pypy-commit] pypy py3.5: add a failing test about typecode y# (more failing tests in this file anyway)

cfbolz pypy.commits at gmail.com
Thu Nov 10 13:51:30 EST 2016


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
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'


More information about the pypy-commit mailing list