summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/test/test_format.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index df78a32..658a302 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -11,26 +11,26 @@ overflowok = 1
def testformat(formatstr, args, output=None):
if verbose:
if output:
- print "%s %% %s =? %s ..." %\
- (repr(formatstr), repr(args), repr(output)),
+ print("%s %% %s =? %s ..." %\
+ (repr(formatstr), repr(args), repr(output)), end=' ')
else:
- print "%s %% %s works? ..." % (repr(formatstr), repr(args)),
+ print("%s %% %s works? ..." % (repr(formatstr), repr(args)), end=' ')
try:
result = formatstr % args
except OverflowError:
if not overflowok:
raise
if verbose:
- print 'overflow (this is fine)'
+ print('overflow (this is fine)')
else:
if output and result != output:
if verbose:
- print 'no'
- print "%s %% %s == %s != %s" %\
- (repr(formatstr), repr(args), repr(result), repr(output))
+ print('no')
+ print("%s %% %s == %s != %s" %\
+ (repr(formatstr), repr(args), repr(result), repr(output)))
else:
if verbose:
- print 'yes'
+ print('yes')
def testboth(formatstr, *args):
testformat(formatstr, *args)
@@ -194,7 +194,7 @@ testboth("%o", -042, "-42")
# Test exception for unknown format characters
if verbose:
- print 'Testing exceptions'
+ print('Testing exceptions')
def test_exc(formatstr, args, exception, excmsg):
try:
@@ -202,13 +202,13 @@ def test_exc(formatstr, args, exception, excmsg):
except exception as exc:
if str(exc) == excmsg:
if verbose:
- print "yes"
+ print("yes")
else:
- if verbose: print 'no'
- print 'Unexpected ', exception, ':', repr(str(exc))
+ if verbose: print('no')
+ print('Unexpected ', exception, ':', repr(str(exc)))
except:
- if verbose: print 'no'
- print 'Unexpected exception'
+ if verbose: print('no')
+ print('Unexpected exception')
raise
else:
raise TestFailed, 'did not get expected exception: %s' % excmsg