diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2011-07-08 10:15:53 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2011-07-08 13:03:13 +0200 |
commit | 09d6cc2a6c857c7ef96432a279a853410718b150 (patch) | |
tree | cae7eaacd9e287e0757ff11076a524e09f4a68c9 | |
parent | e114c3de09d7d95942b308f704a6ca20244dad9d (diff) | |
download | pygobject-09d6cc2a6c857c7ef96432a279a853410718b150.tar.gz |
gdbus tests: Fix hang if test case fails
In the TestGDBusClient.test_native_calls_async() test case, the main loop was
never quit when the call failed.
-rw-r--r-- | tests/test_gdbus.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_gdbus.py b/tests/test_gdbus.py index a9442fea..ca4150a0 100644 --- a/tests/test_gdbus.py +++ b/tests/test_gdbus.py @@ -67,8 +67,10 @@ class TestGDBusClient(unittest.TestCase): def test_native_calls_async(self): def call_done(obj, result, user_data): - user_data['result'] = obj.call_finish(result) - user_data['main_loop'].quit() + try: + user_data['result'] = obj.call_finish(result) + finally: + user_data['main_loop'].quit() main_loop = gobject.MainLoop() data = {'main_loop': main_loop} |