mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
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.
This commit is contained in:
parent
25523d27e7
commit
1d6ec653d0
1 changed files with 5 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue