[pypy-commit] pypy int_w-refactor: add a test which is now passing, but failed before this branch

antocuni noreply at buildbot.pypy.org
Wed Feb 26 11:25:59 CET 2014


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: int_w-refactor
Changeset: r69457:de5ea5e1d969
Date: 2014-02-26 10:30 +0100
http://bitbucket.org/pypy/pypy/changeset/de5ea5e1d969/

Log:	add a test which is now passing, but failed before this branch

diff --git a/pypy/objspace/test/test_descroperation.py b/pypy/objspace/test/test_descroperation.py
--- a/pypy/objspace/test/test_descroperation.py
+++ b/pypy/objspace/test/test_descroperation.py
@@ -721,8 +721,19 @@
                 return CannotConvertToBool()
         x = X()
         raises(MyError, "'foo' in x")
-        
-            
+
+    def test___cmp___fake_int(self):
+        class MyInt(object):
+            def __init__(self, x):
+                self.x = x
+            def __int__(self):
+                return self.x
+        class X(object):
+            def __cmp__(self, other):
+                return MyInt(0)
+
+        assert X() == 'hello'
+
 
 class AppTestWithBuiltinShortcut(AppTest_Descroperation):
     spaceconfig = {'objspace.std.builtinshortcut': True}


More information about the pypy-commit mailing list