<s> """<STR_LIT>""" <EOL> from twisted . trial import itrial , runner , unittest , reporter <EOL> from twisted . trial . test import mockdoctest <EOL> class TestRunners ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_id ( self ) : <EOL> """<STR_LIT>""" <EOL> loader = runner . TestLoader ( ) <EOL> suite = loader . loadDoctests ( mockdoctest ) <EOL> idPrefix = '<STR_LIT>' <EOL> for test in suite . _tests : <EOL> self . assertIn ( idPrefix , itrial . ITestCase ( test ) . id ( ) ) <EOL> def test_basicTrialIntegration ( self ) : <EOL> """<STR_LIT>""" <EOL> loader = runner . TestLoader ( ) <EOL> suite = loader . loadDoctests ( mockdoctest ) <EOL> self . assertEqual ( <NUM_LIT:7> , suite . countTestCases ( ) ) <EOL> def _testRun ( self , suite ) : <EOL> """<STR_LIT>""" <EOL> result = reporter . TestResult ( ) <EOL> suite . run ( result ) <EOL> self . assertEqual ( <NUM_LIT:5> , result . successes ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( result . errors ) + len ( result . failures ) ) <EOL> def test_expectedResults ( self , count = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> suite = runner . TestLoader ( ) . loadDoctests ( mockdoctest ) <EOL> self . _testRun ( suite ) <EOL> def test_repeatable ( self ) : <EOL> """<STR_LIT>""" <EOL> suite = runner . TestLoader ( ) . loadDoctests ( mockdoctest ) <EOL> self . _testRun ( suite ) <EOL> self . _testRun ( suite ) </s>
