Author: Brian Kearns <[email protected]>
Branch:
Changeset: r69583:76a313cc0346
Date: 2014-03-01 15:29 -0500
http://bitbucket.org/pypy/pypy/changeset/76a313cc0346/
Log: cleanup
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
@@ -2,7 +2,6 @@
class AppTestStringObjectWithDict:
-
def test_format_item(self):
d = {'i': 23}
assert 'a23b' == 'a%(i)sb' % d
@@ -36,18 +35,20 @@
assert '' % d == ''
n = 5
raises(TypeError, "'' % n")
+
class MyMapping(object):
def __getitem__(self, key):
py.test.fail('should not be here')
assert '' % MyMapping() == ''
+
class MyMapping2(object):
def __getitem__(self, key):
return key
assert '%(key)s'%MyMapping2() == 'key'
assert u'%(key)s'%MyMapping2() == u'key'
+
class AppTestStringObject:
-
def test_format_item(self):
n = 23
assert 'a23b' == 'a%sb' % n
@@ -130,7 +131,7 @@
def test_format_long(self):
l = 4800000000L
assert '%d' % l == '4800000000'
- #
+
class SubLong(long):
pass
sl = SubLong(l)
@@ -147,7 +148,6 @@
assert '<(1, 2)-(3, 4)>' == '<%s-%s>' % (t, (3,4))
def test_format_dict(self):
-
# I'll just note that the first of these two completely
# contradicts what CPython's documentation says:
@@ -182,7 +182,7 @@
raises(TypeError, '%c'.__mod__, ("bla",))
raises(TypeError, '%c'.__mod__, ("",))
raises(TypeError, '%c'.__mod__, (['c'],))
-
+
def test_broken_unicode(self):
raises(UnicodeDecodeError, 'Názov: %s'.__mod__, u'Jerry')
@@ -192,16 +192,10 @@
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'
@@ -242,7 +236,6 @@
assert "%-05g" % ttf =="2.25 "
assert "%05s" % ttf == " 2.25"
-
def test_star_width(self):
f = 5
assert "%*s" %( f, 'abc') == ' abc'
@@ -281,6 +274,7 @@
assert "%F" % (nan,) == 'NAN'
assert "%G" % (nan,) == 'NAN'
+
class AppTestUnicodeObject:
def test_unicode_convert(self):
u = u"x"
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit