telepathy-gabble: gabbletest: exit if we can't connect to the bus

Will Thompson wjt at kemper.freedesktop.org
Thu Dec 6 09:56:35 PST 2012


Module: telepathy-gabble
Branch: master
Commit: 19b535ebbacf6cc20c0c3fe82cf51815e391f362
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=19b535ebbacf6cc20c0c3fe82cf51815e391f362

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Tue Nov 13 17:13:43 2012 +0000

gabbletest: exit if we can't connect to the bus

Previously, if the bus wasn't there (perhaps I killed it when trying and
failing to ^C the test suite?) the test would just sit there forever
after the unhandled exception made its way up to the mainloop.

---

 tests/twisted/gabbletest.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 83cfd58..838ba78 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -561,7 +561,11 @@ def exec_test_deferred(fun, params, protocol=None, timeout=None,
     if sys.stdout.isatty() or 'CHECK_FORCE_COLOR' in os.environ:
         colourer = servicetest.install_colourer()
 
-    bus = dbus.SessionBus()
+    try:
+        bus = dbus.SessionBus()
+    except dbus.exceptions.DBusException as e:
+        print e
+        os._exit(1)
 
     queue = servicetest.IteratingEventQueue(timeout)
     queue.verbose = (



More information about the telepathy-commits mailing list