Created
April 6, 2015 21:17
-
-
Save ralphm/3c9412421f73cb3c51bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.internet import defer, reactor | |
from twisted.python import log | |
from twisted.trial.unittest import TestCase | |
class Tests(TestCase): | |
timeout = 5 | |
def tearDown(self): | |
log.msg("hi") | |
def test_timeout(self): | |
d = defer.Deferred() | |
cl = reactor.callLater(self.timeout + 1, d.callback, None) | |
self.addCleanup(cl.cancel) | |
return d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment