pypy/module/cpyext/test/test_boolobject.py::TestBoolObject::()::test_fromlong
item = <Function 'test_fromlong'>
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
if isinstance(item, pytest.Function):
config = item.config
if get_marker(item, name='pypy_only'):
if config.applevel is not None and not config.applevel.is_pypy:
pytest.skip('PyPy-specific test')
appclass = item.getparent(pytest.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
# Make cls.space and cls.runappdirect available in tests.
spaceconfig = getattr(appclass.obj, 'spaceconfig', {})
> appclass.obj.space = gettestobjspace(**spaceconfig)
conftest.py:259:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tool/pytest/objspace.py:24: in gettestobjspace
space = maketestobjspace(config)
tool/pytest/objspace.py:34: in maketestobjspace
space = make_objspace(config)
tool/option.py:33: in make_objspace
return StdObjSpace(config)
interpreter/baseobjspace.py:481: in __init__
self.initialize()
objspace/std/objspace.py:118: in initialize
self.setup_builtin_modules()
interpreter/baseobjspace.py:739: in setup_builtin_modules
self.fromcache(State).build_api()
module/cpyext/state.py:128: in build_api
self.api_lib = str(api.build_bridge(self.space))
module/cpyext/api.py:1468: in build_bridge
builder.attach_all(space)
module/cpyext/api.py:1535: in attach_all
attach_recursively(space, static_pyobjs, static_objs_w, attached_objs, i)
module/cpyext/api.py:1497: in attach_recursively
make_ref(space, w_type))
module/cpyext/pyobject.py:510: in make_ref
return get_pyobj_and_incref(space, w_obj, w_userdata, immortal=False)
module/cpyext/pyobject.py:483: in get_pyobj_and_incref
pyobj = as_pyobj(space, w_obj, w_userdata, immortal=immortal)
module/cpyext/pyobject.py:445: in as_pyobj
py_obj = create_ref(space, w_obj, w_userdata, immortal=immortal)
module/cpyext/pyobject.py:326: in create_ref
track_reference(space, py_obj, w_obj)
module/cpyext/pyobject.py:375: in track_reference
w_obj._cpyext_attach_pyobj(space, py_obj)
module/cpyext/pyobject.py:132: in _cpyext_attach_pyobj
rawrefcount.create_link_pypy(self, py_obj)
../rpython/rlib/rawrefcount.py:187: in create_link_pypy
assert not _ob_link_get(ob)
../rpython/rlib/rawrefcount.py:102: in _ob_link_get
return ob.c_ob_pypy_link
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* <C object Struct _object { c_ob_refcnt, c_ob_type } at 0x344e7c40>>
field_name = 'c_ob_pypy_link'
def __getattr__(self, field_name): # ! can only return basic or ptr !
if isinstance(self._T, Struct):
if field_name in self._T._flds:
o = self._obj._getattr(field_name)
return self._expose(field_name, o)
try:
return self._lookup_adtmeth(field_name)
except AttributeError:
raise AttributeError("%r instance has no field %r" % (self._T,
> field_name))
E AttributeError: <Struct _object { c_ob_refcnt, c_ob_type }> instance has no field 'c_ob_pypy_link'
../rpython/rtyper/lltypesystem/lltype.py:1270: AttributeError
builder: own-linux-x86-64 build #10996+
test: pypy/module/cpyext/test/test_boolobject.py::TestBoolObject::()::test_fromlong