From adf4fec37a75a52c710ea3c0f55ca3b092219d61 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 30 Sep 2013 13:07:25 +0100 Subject: [PATCH 06/11] servicetest: if expect() fails, log what was expected It's usually possible to derive it from the backtrace, but logging the pattern (as expect_many() does) makes it quicker. --- tests/twisted/servicetest.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py index c464d8f..821240b 100644 --- a/tests/twisted/servicetest.py +++ b/tests/twisted/servicetest.py @@ -197,7 +197,14 @@ class BaseEventQueue: t = time.time() while True: - event = self.wait([pattern.subqueue]) + try: + event = self.wait([pattern.subqueue]) + except TimeoutError: + self.log('timeout') + self.log('still expecting:') + self.log(' - %r' % pattern) + raise + self._check_forbidden(event) if pattern.match(event): -- 1.8.4.rc3