[pygobject] Make callback exception propagation test stricter
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Make callback exception propagation test stricter
- Date: Mon, 9 Apr 2012 13:22:58 +0000 (UTC)
commit 903283119896f3e054694484da4147788b02ce60
Author: Martin Pitt <martinpitt gnome org>
Date: Mon Apr 9 15:20:39 2012 +0200
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
tests/test_everything.py | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/tests/test_everything.py b/tests/test_everything.py
index b1ba009..b363525 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]