summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-04-05 12:49:14 -0400
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-04-05 12:49:14 -0400
commitf9fd6bebc5f8774395433dfb055b68ddd5de84de (patch)
tree9faa1eb81d553a77fd6292cd40e75f0cafe6886c
parent208a634498e965a6087c6fb59a6d220e91163faf (diff)
parentb8dd9b07c8a90a84bccc0cb348c5801a29d6c68b (diff)
Merge branch 'shutup-servicetest'
-rw-r--r--tests/twisted/servicetest.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index 28ed03f5b..9a18bf445 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -8,9 +8,11 @@ from twisted.internet.protocol import Protocol, Factory, ClientFactory
glib2reactor.install()
import sys
import time
+import os
import pprint
import unittest
+from unittest.runner import TextTestRunner
import dbus.glib
@@ -647,6 +649,16 @@ def install_colourer():
sys.stdout = Colourer(sys.stdout, patterns)
return sys.stdout
-if __name__ == '__main__':
- unittest.main()
+# this is just to shut up unittest.
+class DummyStream(object):
+ def write(self, s):
+ if 'CHECK_TWISTED_VERBOSE' in os.environ:
+ print s,
+
+ def flush(self):
+ pass
+if __name__ == '__main__':
+ stream = DummyStream()
+ runner = TextTestRunner(stream=stream)
+ unittest.main(testRunner=runner)