<div dir="ltr">







<p class="">Hey there,</p>
<p class=""><br></p>
<p class="">I&#39;m trying to start and stop a twisted server in a unittest: <a href="http://dpaste.org/qwaUt/"><span class="">http://dpaste.org/qwaUt/</span></a> .</p>
<p class="">Calling reactor.stop() in the callback causes a KeyboardInterrupt exception, and tearDown gets never executed, as it&#39;s probably waiting for the test to finish.</p>
<p class="">After calling `trial d.py` you need to run a `telnet localhost 8007` manually to stimulate the connectionMade() method.</p>
<p class=""><br></p>
<p class="">I&#39;m totally stuck and would appreciate any help.</p>
<p class=""><br></p>
<p class="">Thanks</p>
<p class="">Fabian</p></div>