[pypy-svn] pypy default: Fix for the precise expected repr() of built-in methods.

arigo commits-noreply at bitbucket.org
Mon Jan 17 10:59:39 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r40751:90e8b076fdd0
Date: 2011-01-17 10:59 +0100
http://bitbucket.org/pypy/pypy/changeset/90e8b076fdd0/

Log:	Fix for the precise expected repr() of built-in methods.

diff --git a/lib-python/2.7.0/test/test_repr.py b/lib-python/modified-2.7.0/test/test_repr.py
copy from lib-python/2.7.0/test/test_repr.py
copy to lib-python/modified-2.7.0/test/test_repr.py
--- a/lib-python/2.7.0/test/test_repr.py
+++ b/lib-python/modified-2.7.0/test/test_repr.py
@@ -9,6 +9,7 @@
 import unittest
 
 from test.test_support import run_unittest, check_py3k_warnings
+from test.test_support import check_impl_detail
 from repr import repr as r # Don't shadow builtin repr
 from repr import Repr
 
@@ -145,8 +146,11 @@
         # Functions
         eq(repr(hash), '<built-in function hash>')
         # Methods
-        self.assertTrue(repr(''.split).startswith(
-            '<built-in method split of str object at 0x'))
+        if check_impl_detail(cpython=True):
+            self.assertTrue(repr(''.split).startswith(
+                '<built-in method split of str object at 0x'))
+        elif check_impl_detail(pypy=True):
+            eq(repr(''.split), "<bound method str.split of ''>")
 
     def test_xrange(self):
         eq = self.assertEquals
@@ -185,7 +189,10 @@
     def test_descriptors(self):
         eq = self.assertEquals
         # method descriptors
-        eq(repr(dict.items), "<method 'items' of 'dict' objects>")
+        if check_impl_detail(cpython=True):
+            eq(repr(dict.items), "<method 'items' of 'dict' objects>")
+        elif check_impl_detail(pypy=True):
+            eq(repr(dict.items), "<unbound method dict.items>")
         # XXX member descriptors
         # XXX attribute descriptors
         # XXX slot descriptors


More information about the Pypy-commit mailing list