[pypy-commit] cffi default: Make the test more precise

arigo noreply at buildbot.pypy.org
Tue Jun 9 20:50:23 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2182:713b2badd33b
Date: 2015-06-09 20:47 +0200
http://bitbucket.org/cffi/cffi/changeset/713b2badd33b/

Log:	Make the test more precise

diff --git a/testing/cffi1/test_recompiler.py b/testing/cffi1/test_recompiler.py
--- a/testing/cffi1/test_recompiler.py
+++ b/testing/cffi1/test_recompiler.py
@@ -410,9 +410,10 @@
     x = type(lib).__dir__.__get__(lib)
     py.test.raises(TypeError, ffi.typeof, x)
     #
-    assert hasattr(lib.sin, '__name__')     # present on built-in functions on
-    assert hasattr(lib.sin, '__module__')   # CPython; must be emulated on PyPy
-    assert hasattr(lib.sin, '__doc__')
+    # present on built-in functions on CPython; must be emulated on PyPy:
+    assert lib.sin.__name__ == 'sin'
+    assert lib.sin.__module__ == '_CFFI_test_math_sin_type'
+    assert lib.sin.__doc__ == 'direct call to the C function of the same name'
 
 def test_verify_anonymous_struct_with_typedef():
     ffi = FFI()


More information about the pypy-commit mailing list