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.
dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/test/simple.py/partition_suite