def _trialSortAlgorithm(self, sorter):
        pkg = getModule('uberpackage')
        testModules = []
        for testModule in pkg.walkModules():
            if testModule.name.split(".")[-1].startswith("test_"):
                testModules.append(testModule)
        sortedModules = sorted(testModules, key=sorter) # ONE
        for modinfo in sortedModules:
            # Now let's find all the classes.
            module = modinfo.load(None)
            if module is None:
                yield modinfo
            else:
                testClasses = []
                for attrib in modinfo.iterAttributes():
                    if runner.isTestCase(attrib.load()):
                        testClasses.append(attrib)
                sortedClasses = sorted(testClasses, key=sorter) # TWO
                for clsinfo in sortedClasses:
                    testMethods = []
                    for attr in clsinfo.iterAttributes():
                        if attr.name.split(".")[-1].startswith('test'):
                            testMethods.append(attr)
                    sortedMethods = sorted(testMethods, key=sorter) # THREE
                    for methinfo in sortedMethods:
                        yield methinfo
Right now, halfway by accident, trial sorts like this:
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/trial/test/test_loader.py/PackageOrderingTest._trialSortAlgorithm