#NEWLINE# def test_cleanup( self ) : #NEWLINE# #INDENT# '\n        Checks that the test suite cleanups its tests during the run, so that\n        it ends empty.\n        ' #NEWLINE# class MockTest ( unittest . TestCase ) : #NEWLINE# #INDENT# def test_foo( test ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# test = MockTest ( 'test_foo' ) #NEWLINE# result = reporter . TestResult ( ) #NEWLINE# suite = runner . DestructiveTestSuite ( [ suite ] ) #NEWLINE# self . assertEquals ( suite . countTestCases ( ) , 1 ) #NEWLINE# suite . run ( result ) #NEWLINE# self . assertEquals ( suite . countTestCases ( ) , 0 )