summaryrefslogtreecommitdiff
path: root/c/test_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'c/test_c.py')
-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():