Debian Codegraph @

pypy/module/cpyext/test/test_cell.py

raw symbols SCIP
1 from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
2
3
4 class AppTestCell(AppTestCpythonExtensionBase):
5 def test_cell_type(self):
6 module = self.import_extension('foo', [
7 ("cell_type", "METH_O",
8 """
9 PyDict_SetItemString(args, "cell", (PyObject*)&PyCell_Type);
10 Py_RETURN_NONE;
11 """)])
12 d = {}
13 module.cell_type(d)
14 def f(o):
15 def g():
16 return o
17 return g
18
19 cell_type = type(f(0).__closure__[0])
20 assert d["cell"] is cell_type