[pypy-commit] pypy py3k: Fix 2 tests on CPython

rlamy pypy.commits at gmail.com
Thu Oct 6 11:14:39 EDT 2016


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3k
Changeset: r87611:e26fef29f49c
Date: 2016-10-06 16:13 +0100
http://bitbucket.org/pypy/pypy/changeset/e26fef29f49c/

Log:	Fix 2 tests on CPython

diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -383,16 +383,7 @@
 class AppTestCpythonExtension(AppTestCpythonExtensionBase):
     def test_createmodule(self):
         import sys
-        init = """
-        if (Py_IsInitialized()) {
-            PyObject *mod = PyImport_AddModule("foo");
-            Py_INCREF(mod);
-            return mod;
-        }
-        PyErr_SetNone(PyExc_RuntimeError);
-        return NULL;
-        """
-        self.import_module(name='foo', init=init)
+        self.import_module(name='foo')
         assert 'foo' in sys.modules
 
     def test_export_function(self):
@@ -408,7 +399,7 @@
         };
         static struct PyModuleDef moduledef = {
             PyModuleDef_HEAD_INIT,
-            "%(modname)s",  /* m_name */
+            "foo",          /* m_name */
             NULL,           /* m_doc */
             -1,             /* m_size */
             methods,        /* m_methods */
@@ -436,7 +427,7 @@
         };
         static struct PyModuleDef moduledef = {
             PyModuleDef_HEAD_INIT,
-            "%(modname)s",  /* m_name */
+            "foo",          /* m_name */
             NULL,           /* m_doc */
             -1,             /* m_size */
             methods,        /* m_methods */


More information about the pypy-commit mailing list