Skip to content

Instantly share code, notes, and snippets.

@adiroiban
Created July 18, 2013 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adiroiban/6029076 to your computer and use it in GitHub Desktop.
Save adiroiban/6029076 to your computer and use it in GitHub Desktop.
def _runDeferred(self, deferred, timeout, debug):
"""
Does the actual deferred execution.
"""
if not deferred.called:
deferred_done = False
while not deferred_done:
self._iterateTestReactor(debug=debug)
deferred_done = deferred.called
if self._timeout_reached:
raise AssertionError(
'Deferred took more than %d to execute.' % timeout)
result = deferred.result
if isinstance(result, Deferred):
self._runDeferred(result, timeout=timeout, debug=debug)
result = deferred.result
if isinstance(result, Deferred):
self._runDeferred(result, timeout=timeout, debug=debug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment