Author: Antonio Cuni <[email protected]>
Branch: int_w-refactor
Changeset: r69458:b401ef2acac2
Date: 2014-02-26 11:08 +0100
http://bitbucket.org/pypy/pypy/changeset/b401ef2acac2/

Log:    another passing test which used to fail

diff --git a/pypy/objspace/std/test/test_stringformat.py 
b/pypy/objspace/std/test/test_stringformat.py
--- a/pypy/objspace/std/test/test_stringformat.py
+++ b/pypy/objspace/std/test/test_stringformat.py
@@ -186,6 +186,22 @@
     def test_broken_unicode(self):
         raises(UnicodeDecodeError, 'N&#225;zov: %s'.__mod__, u'Jerry')
 
+    def test___int__(self):
+        class MyInt(object):
+            def __init__(self, x):
+                self.x = x
+            def __int__(self):
+                return self.x
+        #
+        x = MyInt(65)
+        assert '%c' % x == 'A'
+
+
+class Foo(object):
+    def __cmp__(self, other):
+        return MyInt(0)
+
+
 class AppTestWidthPrec:
     def test_width(self):
         a = 'a'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to