[pypy-svn] r59558 - pypy/trunk/lib-python/modified-2.5.2/test

arigo at codespeak.net arigo at codespeak.net
Thu Oct 30 14:31:14 CET 2008


Author: arigo
Date: Thu Oct 30 14:31:12 2008
New Revision: 59558

Modified:
   pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py
Log:
Make the test for flexible.


Modified: pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py
==============================================================================
--- pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/test_descr.py	Thu Oct 30 14:31:12 2008
@@ -4222,8 +4222,14 @@
     verify(l.__add__ != [5].__add__)
     verify(l.__add__ != l.__mul__)
     verify(l.__add__.__name__ == '__add__')
-    verify(l.__add__.__self__ is l)
-    verify(l.__add__.__objclass__ is list)
+    if hasattr(l.__add__, '__self__'):
+        # CPython
+        verify(l.__add__.__self__ is l)
+        verify(l.__add__.__objclass__ is list)
+    else:
+        # Python implementations where [].__add__ is a normal bound method
+        verify(l.__add__.im_self is l)
+        verify(l.__add__.im_class is list)
     vereq(l.__add__.__doc__, list.__add__.__doc__)
     try:
         hash(l.__add__)



More information about the Pypy-commit mailing list