Created
June 9, 2019 08:28
-
-
Save markrwilliams/766088476387791b5b084c97869f6062 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.defer import Deferred | |
from twisted.trial.unittest import TestCase | |
class Race(TestCase): | |
def test_thing(self): | |
outer, inner = Deferred(), Deferred() | |
def raiser(_): | |
raise ValueError() | |
inner.callback(1) | |
outer.callback(2) | |
outer.addCallback(lambda _: inner) | |
inner.addCallback(raiser) | |
return outer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment