Add the twisted log unconditionally.

This commit is contained in:
Jonathan Lange
2010-10-31 12:33:44 -04:00
parent 53bf3e462a
commit cb70880ad8
2 changed files with 7 additions and 9 deletions

View File

@@ -216,6 +216,9 @@ class AsynchronousDeferredRunTest(RunTest):
[error_observer.gotEvent, full_observer.emit],
self._blocking_run_deferred, spinner)
self.case.addDetail(
'twisted-log', Content(UTF8_TEXT, full_log.readlines))
logged_errors = error_observer.flushErrors()
for logged_error in logged_errors:
successful = False
@@ -239,9 +242,6 @@ class AsynchronousDeferredRunTest(RunTest):
if successful:
self.result.addSuccess(self.case, details=self.case.getDetails())
else:
self.case.addDetail(
'twisted-log', Content(UTF8_TEXT, full_log.readlines))
def _run_user(self, function, *args):
"""Run a user-supplied function.

View File

@@ -9,6 +9,9 @@ from testtools import (
skipIf,
TestCase,
)
from testtools.content import (
text_content,
)
from testtools.deferredruntest import (
assert_fails_with,
AsynchronousDeferredRunTest,
@@ -40,10 +43,6 @@ class X(object):
self.calls.append('tearDown')
super(X.Base, self).tearDown()
class Success(Base):
expected_calls = ['setUp', 'test', 'tearDown', 'clean-up']
expected_results = [['addSuccess']]
class ErrorInSetup(Base):
expected_calls = ['setUp', 'clean-up']
expected_results = [('addError', RuntimeError)]
@@ -109,7 +108,6 @@ def make_integration_tests():
]
tests = [
X.Success,
X.ErrorInSetup,
X.ErrorInTest,
X.ErrorInTearDown,
@@ -578,7 +576,7 @@ class TestAsynchronousDeferredRunTest(TestCase):
result._events,
Equals([
('startTest', test),
('addSuccess', test),
('addSuccess', test, {'twisted-log': text_content('')}),
('stopTest', test)]))
def test_log_in_details(self):