From 09d6cc2a6c857c7ef96432a279a853410718b150 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 8 Jul 2011 10:15:53 +0200 Subject: 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. --- tests/test_gdbus.py | 6 ++++-- 1 file 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} -- cgit v1.2.1