#NEWLINE# def partition_suite( suite , classes , bins ) : #NEWLINE# #INDENT# '\n    Partitions a test suite by test type.\n\n    classes is a sequence of types\n    bins is a sequence of TestSuites, one more than classes\n\n    Tests of type classes[i] are added to bins[i],\n    tests with no match found in classes are place in bins[-1]\n    ' #NEWLINE# for test in suite : #NEWLINE# #INDENT# if isinstance ( test , unittest . TestSuite ) : #NEWLINE# #INDENT# partition_suite ( test , classes , bins ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for i in range ( len ( classes ) ) : #NEWLINE# #INDENT# if isinstance ( suite , classes [ i ] ) : #NEWLINE# #INDENT# bins [ i ] . addTest ( test ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# bins [ ( - 1 ) ] . addTest ( test )