Skip to content

Commit fc505d1

Browse files
committed
rewrite test to pass on pypy
1 parent 4238b88 commit fc505d1

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/test_pythoncapi_compat_cext.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,12 +1972,10 @@ test_unicodewriter_format(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args))
19721972
}
19731973
#endif
19741974

1975-
#ifndef PYPY_VERSION
19761975
static PyObject *
19771976
test_uniquely_referenced(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args))
19781977
{
1979-
const char *str = "Hello World";
1980-
PyObject *obj = PyUnicode_FromString(str);
1978+
PyObject *obj = Py_BuildValue("(s, s)", "hello", "world");
19811979
if (obj == NULL) {
19821980
return NULL;
19831981
}
@@ -1993,7 +1991,6 @@ test_uniquely_referenced(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args))
19931991

19941992
Py_RETURN_NONE;
19951993
}
1996-
#endif
19971994

19981995
static PyObject *
19991996
test_bytes(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
@@ -2350,9 +2347,7 @@ static struct PyMethodDef methods[] = {
23502347
{"test_config", test_config, METH_NOARGS, _Py_NULL},
23512348
#endif
23522349
{"test_sys", test_sys, METH_NOARGS, _Py_NULL},
2353-
#ifndef PYPY_VERSION
23542350
{"test_uniquely_referenced", test_uniquely_referenced, METH_NOARGS, _Py_NULL},
2355-
#endif
23562351
{_Py_NULL, _Py_NULL, 0, _Py_NULL}
23572352
};
23582353

0 commit comments

Comments
 (0)