#NEWLINE# def test_reactor_stop_unblocks_EventualResult( self ) : #NEWLINE# #INDENT# '\n        Any EventualResult.wait() calls still waiting when the reactor has\n        stopped will get a ReactorStopped exception.\n        ' #NEWLINE# program = 'import os, threading, signal, time, sys\n\nfrom twisted.internet.defer import Deferred\nfrom twisted.internet import reactor\n\nimport crochet\ncrochet.setup()\n\n@crochet.run_in_reactor\ndef run():\n    reactor.callLater(0.1, reactor.stop)\n    return Deferred()\n\ner = run()\ntry:\n    er.wait(timeout=10)\nexcept crochet.ReactorStopped:\n    sys.exit(23)\n' #NEWLINE# process = subprocess . Popen ( [ sys . executable , '-c' , self ] , cwd = crochet_directory ) #NEWLINE# self . assertEqual ( process . wait ( ) , 23 )