summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test/test_recno.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/bsddb/test/test_recno.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/bsddb/test/test_recno.py')
-rw-r--r--Lib/bsddb/test/test_recno.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py
index 7bf3695..8baf843 100644
--- a/Lib/bsddb/test/test_recno.py
+++ b/Lib/bsddb/test/test_recno.py
@@ -45,9 +45,9 @@ class SimpleRecnoTestCase(unittest.TestCase):
assert type(recno) == type(0)
assert recno >= 1
if verbose:
- print recno,
+ print(recno, end=' ')
- if verbose: print
+ if verbose: print()
stat = d.stat()
if verbose:
@@ -56,7 +56,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
for recno in range(1, len(d)+1):
data = d[recno]
if verbose:
- print data
+ print(data)
assert type(data) == type("")
assert data == d.get(recno)
@@ -65,7 +65,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
data = d[0] # This should raise a KeyError!?!?!
except db.DBInvalidArgError as val:
assert val[0] == db.EINVAL
- if verbose: print val
+ if verbose: print(val)
else:
self.fail("expected exception")
@@ -94,7 +94,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
keys = d.keys()
if verbose:
- print keys
+ print(keys)
assert type(keys) == type([])
assert type(keys[0]) == type(123)
assert len(keys) == len(d)
@@ -120,23 +120,23 @@ class SimpleRecnoTestCase(unittest.TestCase):
data = d.get_both(26, "z" * 60)
assert data == "z" * 60
if verbose:
- print data
+ print(data)
fd = d.fd()
if verbose:
- print fd
+ print(fd)
c = d.cursor()
rec = c.first()
while rec:
if verbose:
- print rec
+ print(rec)
rec = c.next()
c.set(50)
rec = c.current()
if verbose:
- print rec
+ print(rec)
c.put(-1, "a replacement record", db.DB_CURRENT)
@@ -144,18 +144,18 @@ class SimpleRecnoTestCase(unittest.TestCase):
rec = c.current()
assert rec == (50, "a replacement record")
if verbose:
- print rec
+ print(rec)
rec = c.set_range(30)
if verbose:
- print rec
+ print(rec)
# test that non-existant key lookups work (and that
# DBC_set_range doesn't have a memleak under valgrind)
rec = c.set_range(999999)
assert rec == None
if verbose:
- print rec
+ print(rec)
c.close()
d.close()
@@ -182,7 +182,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
self.fail("unexpected DBKeyEmptyError exception")
else:
assert val[0] == db.DB_KEYEMPTY
- if verbose: print val
+ if verbose: print(val)
else:
if not get_returns_none:
self.fail("expected exception")
@@ -190,7 +190,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
rec = c.set(40)
while rec:
if verbose:
- print rec
+ print(rec)
rec = c.next()
c.close()
@@ -227,9 +227,9 @@ class SimpleRecnoTestCase(unittest.TestCase):
text = open(source, 'r').read()
text = text.strip()
if verbose:
- print text
- print data
- print text.split('\n')
+ print(text)
+ print(data)
+ print(text.split('\n'))
assert text.split('\n') == data
@@ -247,8 +247,8 @@ class SimpleRecnoTestCase(unittest.TestCase):
text = open(source, 'r').read()
text = text.strip()
if verbose:
- print text
- print text.split('\n')
+ print(text)
+ print(text.split('\n'))
assert text.split('\n') == \
"The quick reddish-brown fox jumped over the comatose dog".split()
@@ -269,7 +269,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
d.append('bad' * 20)
except db.DBInvalidArgError as val:
assert val[0] == db.EINVAL
- if verbose: print val
+ if verbose: print(val)
else:
self.fail("expected exception")
@@ -277,7 +277,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
rec = c.first()
while rec:
if verbose:
- print rec
+ print(rec)
rec = c.next()
c.close()