Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95780:7909694b7ee1
Date: 2019-02-03 08:01 +0200
http://bitbucket.org/pypy/pypy/changeset/7909694b7ee1/
Log: skip test on windows
diff --git a/pypy/module/cpyext/test/_widechar.c
b/pypy/module/cpyext/test/_widechar.c
--- a/pypy/module/cpyext/test/_widechar.c
+++ b/pypy/module/cpyext/test/_widechar.c
@@ -19,8 +19,15 @@
return wide;
}
+static PyObject *
+get_sizeof_wchar(PyObject *self)
+{
+ return PyLong_FromLong(sizeof(wchar_t));
+}
+
static PyMethodDef TestMethods[] = {
- {"test_widechar", (PyCFunction)test_widechar, METH_NOARGS},
+ {"test_widechar", (PyCFunction)test_widechar, METH_NOARGS},
+ {"get_sizeof_wchar", (PyCFunction)get_sizeof_wchar,METH_NOARGS},
{NULL, NULL} /* sentinel */
};
diff --git a/pypy/module/cpyext/test/test_unicodeobject.py
b/pypy/module/cpyext/test/test_unicodeobject.py
--- a/pypy/module/cpyext/test/test_unicodeobject.py
+++ b/pypy/module/cpyext/test/test_unicodeobject.py
@@ -371,6 +371,8 @@
def test_invalid(self):
m = self.import_module('_widechar')
+ if m.get_sizeof_wchar() != 4:
+ pytest.skip('only for sizeof(wchar)==4')
raises(ValueError, m.test_widechar)
def test_AsUTFNString(self):
@@ -719,7 +721,7 @@
w_bytes = PyUnicode_EncodeMBCS(space, wbuf, 4, None)
rffi.free_wcharp(wbuf)
assert space.type(w_bytes) is space.w_bytes
- assert space.text_w(w_bytes) == "abc?"
+ assert space.utf8_w(w_bytes) == "abc?"
def test_escape(self, space):
def test(ustr):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit