[Telepathy-commits] [telepathy-gabble/master] gabbletest.py: rearrange code

Dafydd Harries dafydd.harries at collabora.co.uk
Tue Aug 19 10:52:24 PDT 2008


20080507023216-c9803-74114315c363b6772829372831a986d27700af70.gz
---
 tests/twisted/gabbletest.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 7589dd1..758de41 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -286,6 +286,12 @@ def install_colourer():
     sys.stdout = Colourer(sys.stdout, patterns)
 
 def exec_test(fun, params=None, protocol=None, timeout=None):
+    # hack to ease debugging
+    domish.Element.__repr__ = domish.Element.toXml
+
+    if sys.stdout.isatty():
+        install_colourer()
+
     queue = servicetest.IteratingEventQueue(timeout)
     queue.verbose = (
         os.environ.get('CHECK_TWISTED_VERBOSE', '') != ''
@@ -294,12 +300,6 @@ def exec_test(fun, params=None, protocol=None, timeout=None):
     bus = dbus.SessionBus()
     conn, stream = prepare_test(bus, queue.append, params, protocol=protocol)
 
-    # hack to ease debugging
-    domish.Element.__repr__ = domish.Element.toXml
-
-    if sys.stdout.isatty():
-        install_colourer()
-
     try:
         fun(queue, bus, conn, stream)
     finally:
-- 
1.5.6.3




More information about the Telepathy-commits mailing list