summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-09 16:13:23 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-09 16:13:23 (GMT)
commit38e43c25eede3fa77d90ac8183cc0335f4861f4a (patch)
tree2a6207bb237550ce004b2a20ee603dddb4db9c2c
parent3f1e65cfde6ebfc1be580bac44fda5c15176f30b (diff)
downloadcpython-38e43c25eede3fa77d90ac8183cc0335f4861f4a.zip
cpython-38e43c25eede3fa77d90ac8183cc0335f4861f4a.tar.gz
cpython-38e43c25eede3fa77d90ac8183cc0335f4861f4a.tar.bz2
Adapt to new exception message.
Simplify formatting (use "%r" % x instead of "%s" % repr(x)).
-rw-r--r--Lib/test/test_format.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 9e9aec5..ace1f1f 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -13,10 +13,10 @@ overflowok = 1
def testformat(formatstr, args, output=None):
if verbose:
if output:
- print("%s %% %s =? %s ..." %\
- (repr(formatstr), repr(args), repr(output)), end=' ')
+ print("%r %% %r =? %r ..." %\
+ (formatstr, args, output), end=' ')
else:
- print("%s %% %s works? ..." % (repr(formatstr), repr(args)), end=' ')
+ print("%r %% %r works? ..." % (formatstr, args), end=' ')
try:
result = formatstr % args
except OverflowError:
@@ -28,8 +28,8 @@ def testformat(formatstr, args, output=None):
if output and result != output:
if verbose:
print('no')
- print("%s %% %s == %s != %s" %\
- (repr(formatstr), repr(args), repr(result), repr(output)))
+ print("%r %% %r == %r != %r" %\
+ (formatstr, args, result, output))
else:
if verbose:
print('yes')
@@ -222,7 +222,7 @@ class Foobar(int):
return self + 1
test_exc('%o', Foobar(), TypeError,
- "expected str object, int found")
+ "expected string, int found")
if maxsize == 2**31-1:
# crashes 2.2.1 and earlier: