Author: Armin Rigo <ar...@tunes.org>
Branch: verifier2
Changeset: r774:e4a09c2d87f3
Date: 2012-08-04 16:35 +0200
http://bitbucket.org/cffi/cffi/changeset/e4a09c2d87f3/

Log:    Skip the tail of these two tests if not building a CPython C
        extension module.

diff --git a/cffi/verifier.py b/cffi/verifier.py
--- a/cffi/verifier.py
+++ b/cffi/verifier.py
@@ -70,6 +70,9 @@
         modname = self.get_module_name()
         return ffiplatform.get_extension(sourcename, modname, **self.kwds)
 
+    def generates_python_module(self):
+        return False
+
     # ----------
 
     def _locate_module(self):
diff --git a/testing/test_zdistutils.py b/testing/test_zdistutils.py
--- a/testing/test_zdistutils.py
+++ b/testing/test_zdistutils.py
@@ -43,8 +43,9 @@
     v = Verifier(ffi, csrc)
     v.compile_module()
     assert v.get_module_name().startswith('_cffi_')
-    mod = imp.load_dynamic(v.get_module_name(), v.modulefilename)
-    assert hasattr(mod, '_cffi_setup')
+    if v.generates_python_module():
+        mod = imp.load_dynamic(v.get_module_name(), v.modulefilename)
+        assert hasattr(mod, '_cffi_setup')
 
 def test_compile_module_explicit_filename():
     ffi = FFI()
@@ -55,8 +56,9 @@
     v.compile_module()
     assert filename == v.modulefilename
     assert v.get_module_name() == 'test_compile_module'
-    mod = imp.load_dynamic(v.get_module_name(), v.modulefilename)
-    assert hasattr(mod, '_cffi_setup')
+    if v.generates_python_module():
+        mod = imp.load_dynamic(v.get_module_name(), v.modulefilename)
+        assert hasattr(mod, '_cffi_setup')
 
 def test_name_from_checksum_of_cdef():
     names = []
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to