Commit 90328311 authored by Martin Pitt's avatar Martin Pitt
Browse files

Make callback exception propagation test stricter

Propagating Python exceptions from callbacks through the C context back to the
original caller does not currently happen, is nontrivial/unsafe to implement,
and not desirable at this point any more as by now we have established the
current behaviour. So remove the catching of ZeroDivisionError in the tests.

https://bugzilla.gnome.org/show_bug.cgi?id=616279
parent 0fd900d3
......@@ -268,10 +268,10 @@ class TestCallbacks(unittest.TestCase):
x = 1 / 0
self.fail('unexpected surviving zero divsion:' + str(x))
try:
Everything.test_simple_callback(callback)
except ZeroDivisionError:
pass
# note that we do NOT expect the ZeroDivisionError to be propagated
# through from the callback, as it crosses the Python<->C boundary
# twice. (See GNOME #616279)
Everything.test_simple_callback(callback)
def test_double_callback_exception(self):
"""
......@@ -287,10 +287,10 @@ class TestCallbacks(unittest.TestCase):
Everything.test_boolean(False)
Everything.test_simple_callback(badcallback())
try:
Everything.test_simple_callback(callback)
except ZeroDivisionError:
pass
# note that we do NOT expect the ZeroDivisionError to be propagated
# through from the callback, as it crosses the Python<->C boundary
# twice. (See GNOME #616279)
Everything.test_simple_callback(callback)
def test_return_value_callback(self):
TestCallbacks.called = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment