| 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 |
|
| 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 |
|
| 14 |
|
| 15 |
def dummy_prepare_file_argument(space, fileobj): |
| 16 |
|
| 17 |
|
| 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 |