def partition_suite(suite, classes, bins):
 for test in suite:
  if isinstance(test, unittest.TestSuite):
   partition_suite(test, classes, bins)
  else:
   for i in range(len(classes)):
    if isinstance(test, classes[i]):
     bins[i].addTest(test)
     break
   else:
    bins[(-1)].addTest(test)

def partition_suite ( suite , classes , bins ) : for test in suite : if isinstance ( test , unittest . TestSuite ) : partition_suite ( test , classes , bins ) else : for i in range ( len ( classes ) ) : if isinstance ( test , classes [ i ] ) : bins [ i ] . addTest ( test ) break else : bins [ ( - 1 ) ] . addTest ( test )
partitions a test suite by test type .