Make the tests succeed with -Qnew: Do not rely on the exact wording of a ZeroDivisionError.
This commit is contained in:
parent
f871270c92
commit
240ec6b9ef
|
@ -51,16 +51,14 @@ class CallbackTracbackTestCase(unittest.TestCase):
|
||||||
def test_IntegerDivisionError(self):
|
def test_IntegerDivisionError(self):
|
||||||
cb = CFUNCTYPE(c_int, c_int)(callback_func)
|
cb = CFUNCTYPE(c_int, c_int)(callback_func)
|
||||||
out = self.capture_stderr(cb, 0)
|
out = self.capture_stderr(cb, 0)
|
||||||
self.failUnlessEqual(out.splitlines()[-1],
|
self.failUnlessEqual(out.splitlines()[-1][:19],
|
||||||
"ZeroDivisionError: "
|
"ZeroDivisionError: ")
|
||||||
"integer division or modulo by zero")
|
|
||||||
|
|
||||||
def test_FloatDivisionError(self):
|
def test_FloatDivisionError(self):
|
||||||
cb = CFUNCTYPE(c_int, c_double)(callback_func)
|
cb = CFUNCTYPE(c_int, c_double)(callback_func)
|
||||||
out = self.capture_stderr(cb, 0.0)
|
out = self.capture_stderr(cb, 0.0)
|
||||||
self.failUnlessEqual(out.splitlines()[-1],
|
self.failUnlessEqual(out.splitlines()[-1][:19],
|
||||||
"ZeroDivisionError: "
|
"ZeroDivisionError: ")
|
||||||
"float division")
|
|
||||||
|
|
||||||
def test_TypeErrorDivisionError(self):
|
def test_TypeErrorDivisionError(self):
|
||||||
cb = CFUNCTYPE(c_int, c_char_p)(callback_func)
|
cb = CFUNCTYPE(c_int, c_char_p)(callback_func)
|
||||||
|
|
Loading…
Reference in New Issue