Some simple changes from code review.

This commit is contained in:
Jonathan Lange
2010-10-31 12:11:45 -04:00
parent a707db7047
commit 7a31bd4b46
2 changed files with 7 additions and 5 deletions

View File

@@ -194,7 +194,12 @@ class Spinner(object):
self._stop_reactor()
def _clean(self):
"""Clean up any junk in the reactor."""
"""Clean up any junk in the reactor.
This will *always* spin the reactor at least once. We do this in
order to give the reactor a chance to do the disconnections and
terminations that were asked of it.
"""
# If we've just run a method that calls, say, loseConnection and then
# returns, then the reactor might not have had a chance to actually
# close the connection yet. Here we explicitly give it such a chance.

View File

@@ -240,11 +240,8 @@ class AsynchronousDeferredRunTest(RunTest):
if successful:
self.result.addSuccess(self.case, details=self.case.getDetails())
else:
# XXX: Maybe we should only add this when there is something worth
# adding? i.e. don't add when it's empty.
self.case.addDetail(
'twisted-log',
Content(UTF8_TEXT, lambda: [full_log.getvalue()]))
'twisted-log', Content(UTF8_TEXT, full_log.readlines))
def _run_user(self, function, *args):
"""Run a user-supplied function.