summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-01-09 12:05:25 +0000
committerRichard van der Hoff <richard@matrix.org>2018-01-09 12:06:45 +0000
commitf8fa5ae4af770cdf69e2d335f3aff0b823b34009 (patch)
tree6f24d9b4413044501d8658f0a8328c84a9bfc759 /tests
parentRemove dead code (diff)
downloadsynapse-f8fa5ae4af770cdf69e2d335f3aff0b823b34009.tar.xz
enable twisted delayedcall debugging in UTs
Diffstat (limited to '')
-rw-r--r--tests/unittest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index 38715972dd..7b478c4294 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -12,7 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
+import twisted
 from twisted.trial import unittest
 
 import logging
@@ -65,6 +65,10 @@ class TestCase(unittest.TestCase):
 
         @around(self)
         def setUp(orig):
+            # enable debugging of delayed calls - this means that we get a
+            # traceback when a unit test exits leaving things on the reactor.
+            twisted.internet.base.DelayedCall.debug = True
+
             old_level = logging.getLogger().level
 
             if old_level != level: