def loadSortedPackages(self, sorter=runner.name):
        """
        Verify that packages are loaded in the correct order.
        """
        import uberpackage
        self.loader.sorter = sorter
        suite = self.loader.loadPackage(uberpackage, recurse=True)
        # XXX: Work around strange, unexplained Zope crap.
        # jml, 2007-11-15.
        suite = unittest.decorate(suite, ITestCase)
        resultingTests = list(_iterateTests(suite))
        manifest = list(self._trialSortAlgorithm(sorter))
        for number, (manifestTest, actualTest) in enumerate(
            zip(manifest, resultingTests)):
            self.assertEqual(
                 manifestTest.name, actualTest.id(),
                 "#%d: %s != %s" %
                 (number, manifestTest.name, actualTest.id()))
        self.assertEqual(len(manifest), len(resultingTests))

        Verify that packages are loaded in the correct order.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_loader.py