<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from twisted . trial import unittest , util <EOL> from twisted . internet import reactor , protocol , defer <EOL> class FoolishError ( Exception ) : <EOL> pass <EOL> class FailureInSetUpMixin ( object ) : <EOL> def setUp ( self ) : <EOL> raise FoolishError , "<STR_LIT>" <EOL> def test_noop ( self ) : <EOL> pass <EOL> class SynchronousTestFailureInSetUp ( <EOL> FailureInSetUpMixin , unittest . SynchronousTestCase ) : <EOL> pass <EOL> class AsynchronousTestFailureInSetUp ( <EOL> FailureInSetUpMixin , unittest . TestCase ) : <EOL> pass <EOL> class FailureInTearDownMixin ( object ) : <EOL> def tearDown ( self ) : <EOL> raise FoolishError , "<STR_LIT>" <EOL> def test_noop ( self ) : <EOL> pass <EOL> class SynchronousTestFailureInTearDown ( <EOL> FailureInTearDownMixin , unittest . SynchronousTestCase ) : <EOL> pass <EOL> class AsynchronousTestFailureInTearDown ( <EOL> FailureInTearDownMixin , unittest . TestCase ) : <EOL> pass <EOL> class TestRegularFail ( unittest . SynchronousTestCase ) : <EOL> def test_fail ( self ) : <EOL> self . fail ( "<STR_LIT>" ) <EOL> def test_subfail ( self ) : <EOL> self . subroutine ( ) <EOL> def subroutine ( self ) : <EOL> self . fail ( "<STR_LIT>" ) <EOL> class TestFailureInDeferredChain ( unittest . TestCase ) : <EOL> def test_fail ( self ) : <EOL> d = defer . Deferred ( ) <EOL> d . addCallback ( self . _later ) <EOL> reactor . callLater ( <NUM_LIT:0> , d . callback , None ) <EOL> return d <EOL> def _later ( self , res ) : <EOL> self . fail ( "<STR_LIT>" ) <EOL> class ErrorTest ( unittest . SynchronousTestCase ) : <EOL> """<STR_LIT>""" <EOL> ran = False <EOL> def test_foo ( self ) : <EOL> """<STR_LIT>""" <EOL> self . ran = True <EOL> <NUM_LIT:1> / <NUM_LIT:0> <EOL> class TestSkipTestCase ( unittest . SynchronousTestCase ) : <EOL> pass <EOL> TestSkipTestCase . skip = "<STR_LIT>" <EOL> class DelayedCall ( unittest . TestCase ) : <EOL> hiddenExceptionMsg = "<STR_LIT>" <EOL> def go ( self ) : <EOL> raise RuntimeError ( self . hiddenExceptionMsg ) <EOL> def testHiddenException ( self ) : <EOL> """<STR_LIT>""" <EOL> reactor . callLater ( <NUM_LIT:0> , self . go ) <EOL> reactor . iterate ( <NUM_LIT> ) <EOL> self . fail ( "<STR_LIT>" ) <EOL> testHiddenException . suppress = [ util . suppress ( <EOL> message = r'<STR_LIT>' , <EOL> category = DeprecationWarning ) ] <EOL> class ReactorCleanupTests ( unittest . TestCase ) : <EOL> def test_leftoverPendingCalls ( self ) : <EOL> def _ ( ) : <EOL> print '<STR_LIT>' <EOL> reactor . callLater ( <NUM_LIT> , _ ) <EOL> class SocketOpenTest ( unittest . TestCase ) : <EOL> def test_socketsLeftOpen ( self ) : <EOL> f = protocol . Factory ( ) <EOL> f . protocol = protocol . Protocol <EOL> reactor . listenTCP ( <NUM_LIT:0> , f ) <EOL> class TimingOutDeferred ( unittest . TestCase ) : <EOL> def test_alpha ( self ) : <EOL> pass <EOL> def test_deferredThatNeverFires ( self ) : <EOL> self . methodCalled = True <EOL> d = defer . Deferred ( ) <EOL> return d <EOL> def test_omega ( self ) : <EOL> pass <EOL> def unexpectedException ( self ) : <EOL> """<STR_LIT>""" </s>
