Debian Codegraph @

pypy/module/_cffi_backend/test/test_ztranslation.py

raw symbols SCIP
1 import pytest
2 from pypy.objspace.fake.checkmodule import checkmodule
3 from pypy.module._cffi_backend import ctypeptr
4 from rpython.rtyper.lltypesystem import lltype, rffi
5
6 # side-effect: FORMAT_LONGDOUBLE must be built before test_checkmodule()
7 from pypy.module._cffi_backend import misc
8 from pypy.module._cffi_backend import embedding
9
10
11 @pytest.mark.skip(reason="Requires too much space emulation")
12 def test_checkmodule():
13 # prepare_file_argument() is not working without translating the _file
14 # module too
15 def dummy_prepare_file_argument(space, fileobj):
16 # call pypy_init_embedded_cffi_module() from a random place like here
17 # --- this calls load_cffi1_module(), too
18 embedding.pypy_init_embedded_cffi_module(
19 rffi.cast(rffi.INT, embedding.EMBED_VERSION_MIN),
20 42)
21 return lltype.nullptr(rffi.CCHARP.TO)
22 old = ctypeptr.prepare_file_argument
23 try:
24 ctypeptr.prepare_file_argument = dummy_prepare_file_argument
25 #
26 checkmodule('_cffi_backend')
27 #
28 finally:
29 ctypeptr.prepare_file_argument = old