Skip to content

Commit 1d6ec65

Browse files
committed
fix test, use bytes not unicode and let the test raise its internal exception
rather than just complaining about stderr not being what we expected masking the true problem.
1 parent 25523d2 commit 1d6ec65

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/bsddb/test/test_compare.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ def verifyStderr(self, method, successRe):
179179
finally:
180180
temp = sys.stderr
181181
sys.stderr = stdErr
182-
errorOut = temp.getvalue()
183-
if not successRe.search(errorOut):
184-
self.fail("unexpected stderr output: %r" % errorOut)
182+
errorOut = temp.getvalue()
183+
if not successRe.search(errorOut):
184+
self.fail("unexpected stderr output: %r" % errorOut)
185185

186186
def _test_compare_function_exception (self):
187187
self.startTest ()
@@ -192,7 +192,7 @@ def bad_comparator (l, r):
192192
raise RuntimeError("i'm a naughty comparison function")
193193
self.createDB (bad_comparator)
194194
#print "\n*** test should print 2 uncatchable tracebacks ***"
195-
self.addDataToDB (['a', 'b', 'c']) # this should raise, but...
195+
self.addDataToDB ([b'a', b'b', b'c']) # this should raise, but...
196196
self.finishTest ()
197197

198198
def test_compare_function_exception(self):
@@ -210,7 +210,7 @@ def bad_comparator (l, r):
210210
return l
211211
self.createDB (bad_comparator)
212212
#print "\n*** test should print 2 errors about returning an int ***"
213-
self.addDataToDB (['a', 'b', 'c']) # this should raise, but...
213+
self.addDataToDB ([b'a', b'b', b'c']) # this should raise, but...
214214
self.finishTest ()
215215

216216
def test_compare_function_bad_return(self):

0 commit comments

Comments
 (0)