diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2007-09-03 16:48:32 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2007-09-03 16:48:32 (GMT) |
commit | 1d6ec653d003e5ad16e0cf7bb6df62b0135f9ea8 (patch) | |
tree | 0f4565757282ceb95f44c7676afafe2cc88d0022 /Lib/bsddb/test | |
parent | 25523d27e7f363e4690a8f56aefce146eeacb2d3 (diff) | |
download | cpython-1d6ec653d003e5ad16e0cf7bb6df62b0135f9ea8.zip cpython-1d6ec653d003e5ad16e0cf7bb6df62b0135f9ea8.tar.gz cpython-1d6ec653d003e5ad16e0cf7bb6df62b0135f9ea8.tar.bz2 |
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.
Diffstat (limited to 'Lib/bsddb/test')
-rw-r--r-- | Lib/bsddb/test/test_compare.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/bsddb/test/test_compare.py b/Lib/bsddb/test/test_compare.py index 0a57590..f823a75 100644 --- a/Lib/bsddb/test/test_compare.py +++ b/Lib/bsddb/test/test_compare.py @@ -179,9 +179,9 @@ class BtreeExceptionsTestCase (AbstractBtreeKeyCompareTestCase): finally: temp = sys.stderr sys.stderr = stdErr - errorOut = temp.getvalue() - if not successRe.search(errorOut): - self.fail("unexpected stderr output: %r" % errorOut) + errorOut = temp.getvalue() + if not successRe.search(errorOut): + self.fail("unexpected stderr output: %r" % errorOut) def _test_compare_function_exception (self): self.startTest () @@ -192,7 +192,7 @@ class BtreeExceptionsTestCase (AbstractBtreeKeyCompareTestCase): raise RuntimeError("i'm a naughty comparison function") self.createDB (bad_comparator) #print "\n*** test should print 2 uncatchable tracebacks ***" - self.addDataToDB (['a', 'b', 'c']) # this should raise, but... + self.addDataToDB ([b'a', b'b', b'c']) # this should raise, but... self.finishTest () def test_compare_function_exception(self): @@ -210,7 +210,7 @@ class BtreeExceptionsTestCase (AbstractBtreeKeyCompareTestCase): return l self.createDB (bad_comparator) #print "\n*** test should print 2 errors about returning an int ***" - self.addDataToDB (['a', 'b', 'c']) # this should raise, but... + self.addDataToDB ([b'a', b'b', b'c']) # this should raise, but... self.finishTest () def test_compare_function_bad_return(self): |