From 367e4ededd4a45125157050bcc9e4e685fd4a82d 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(-) (limited to 'tests/test_gdbus.py') diff --git a/tests/test_gdbus.py b/tests/test_gdbus.py index 19fd76dc..b5a8493d 100644 --- a/tests/test_gdbus.py +++ b/tests/test_gdbus.py @@ -62,8 +62,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