summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-11-13 17:13:43 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-12-06 17:52:29 +0000
commit19b535ebbacf6cc20c0c3fe82cf51815e391f362 (patch)
tree36887acc60e79d4539347454094916c4b4fc9d27 /tests
parent13470c3c4f1602190bcf427911ceb6bb784d9cda (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/gabbletest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 83cfd5855..838ba7892 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 = (