[pypy-svn] r59036 - pypy/trunk/pypy/objspace/std/test
antocuni at codespeak.net
antocuni at codespeak.net
Sun Oct 12 17:12:39 CEST 2008
Author: antocuni
Date: Sun Oct 12 17:12:36 2008
New Revision: 59036
Modified:
pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py
Log:
(antocuni, iko)
write two failing tests for behaviour that changed from 2.4 to 2.5; it seems
that we can't fix them, though :-(
Modified: pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py (original)
+++ pypy/trunk/pypy/objspace/std/test/test_unicodeobject.py Sun Oct 12 17:12:36 2008
@@ -674,3 +674,31 @@
buf = buffer('character buffers are decoded to unicode')
u = unicode(buf, 'utf-8', 'strict')
assert u == u'character buffers are decoded to unicode'
+
+ def test_formatting_unicode__str__(self):
+ skip('fixme!')
+ class A:
+ def __str__(self):
+ return u'\u1234'
+
+ s = '%s' % A()
+ assert type(s) is unicode
+ assert s == u'\u1234'
+
+ def test_formatting_unicode__str__2(self):
+ skip('XXX: do we really want to have such behaviour? CPython has not tests for that')
+ class A:
+ def __str__(self):
+ return u'baz'
+
+ class B:
+ def __str__(self):
+ return 'foo'
+
+ def __unicode__(self):
+ return u'bar'
+
+ a = A()
+ b = B()
+ s = '%s %s' % (b, a)
+ assert s == u'foo baz'
More information about the Pypy-commit
mailing list