summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2020-08-31 19:34:35 +0200
committerArmin Rigo <arigo@tunes.org>2020-08-31 19:34:35 +0200
commit9dfd48b25e2d1bf12611dbb802020e3d5cbf5d2f (patch)
treeb4568213e353a8329f0a91839d40e91e159b0c09
parent75aaa036dda345154c21d9699c37537ea9bfeeb1 (diff)
parentc8f247e223efc561173100bfc27fa059b950f626 (diff)
downloadcffi-9dfd48b25e2d1bf12611dbb802020e3d5cbf5d2f.tar.gz
merge heads
-rw-r--r--c/test_c.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/c/test_c.py b/c/test_c.py
index 9348afd..e76950f 100644
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3,17 +3,15 @@ import pytest
def _setup_path():
import os, sys
- if '__pypy__' in sys.builtin_module_names:
- global pytestmark
- pytestmark = pytest.mark.skip(
- "_cffi_backend.c: not tested on top of pypy, "
- "use pypy/module/_cffi_backend/test/ instead.")
- return False
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
- return True
-if _setup_path():
- from _cffi_backend import _testfunc, _get_types, _get_common_types
+_setup_path()
from _cffi_backend import *
+from _cffi_backend import _get_types, _get_common_types
+try:
+ from _cffi_backend import _testfunc
+except ImportError:
+ def _testfunc(num):
+ pytest.skip("_testunc() not available")
from _cffi_backend import __version__
# ____________________________________________________________
@@ -70,8 +68,10 @@ def find_and_load_library(name, flags=RTLD_NOW):
path = ctypes.util.find_library(name)
if path is None and name == 'c':
assert sys.platform == 'win32'
- assert sys.version_info >= (3,)
- py.test.skip("dlopen(None) cannot work on Windows with Python 3")
+ assert (sys.version_info >= (3,) or
+ '__pypy__' in sys.builtin_module_names)
+ py.test.skip("dlopen(None) cannot work on Windows "
+ "with PyPy or Python 3")
return load_library(path, flags)
def test_load_library():