

def gatherHead(self):
    head = []

    def gather(testInstances):
        for test in testInstances:
            if isinstance(test, list):
                head.extend(gather(test))
            else:
                head.append(test.head())
    gather(self.testInstances)
    return filter(None, head)

dataset/ETHPy150Open twisted/nevow/nevow/livetrial/runner.py TestSuiteFragment.gatherHead/original